Need headless browser for Armv7 linux processor

点点圈 提交于 2019-12-13 03:54:41

问题


I need a headless browser for webscraping.Recently i tried 3 different headless browsers(PhantomJS,Firefox,Chrome).

When using phantomJS, it gives some error (i.e):Armv7 processor needs GUI.

then,am using Firefox with geckodriver, it shows errors in the path and connection refused.

so that i moved to chrome headless browser with chromedriver,but it also shows same errors as Firefox.

So,I need a correct headless browser for Armv7 processor. Can anyone suggest solution for that or any other way to proceed further.


回答1:


Installing lower version of selenium fixed my issue in a similar case.

pip install selenium==2.53.5



回答2:


Try the below procedure it worked for me.

geckodriver v0.19.0 the following versions are recommended:

Firefox 55.0 (and greater) Selenium 3.5 (and greater)

Download the geckodriver from https://github.com/mozilla/geckodriver/releases. After downloading, extract it and make it executable(in linux chmod +x path/to/geckdriver).

from selenium import webdriver

geckoPath = 'path/to/geckodriver'
browser = webdriver.Firefox(executable_path=geckoPath)
browser.get('http://stackoverflow.com')
body_html = driver.find_element_by_xpath("/html/body")
print body_html.text


来源:https://stackoverflow.com/questions/49172172/need-headless-browser-for-armv7-linux-processor

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!