[英]Need headless browser for Armv7 linux processor
I need a headless browser for webscraping.Recently i tried 3 different headless browsers( PhantomJS,Firefox,Chrome ). 我需要一个无头浏览器进行网络抓取。最近,我尝试了3种不同的无头浏览器( PhantomJS,Firefox,Chrome )。
When using phantomJS , it gives some error (ie):Armv7 processor needs GUI . 使用phantomJS时 ,会出现一些错误(即):Armv7处理器需要GUI 。
then,am using Firefox with geckodriver , it shows errors in the path and connection refused . 然后,使用带有geckodriver的Firefox ,它显示路径错误和连接被拒绝 。
so that i moved to chrome headless browser with chromedriver ,but it also shows same errors as Firefox . 因此,我使用chromedriver移至chrome无头浏览器 ,但它也显示了与Firefox相同的错误 。
So,I need a correct headless browser for Armv7 processor. 因此,我需要用于Armv7处理器的正确的无头浏览器。 Can anyone suggest solution for that or any other way to proceed further. 任何人都可以为该解决方案或任何其他方法提出进一步解决方案的建议。
安装较低版本的selenium在类似情况下解决了我的问题。
pip install selenium==2.53.5
Try the below procedure it worked for me. 请尝试以下对我有用的过程。
geckodriver v0.19.0 the following versions are recommended: geckodriver v0.19.0推荐以下版本:
Firefox 55.0 (and greater) Selenium 3.5 (and greater) Firefox 55.0(及更高版本)Selenium 3.5(及更高版本)
Download the geckodriver from https://github.com/mozilla/geckodriver/releases . 从https://github.com/mozilla/geckodriver/releases下载geckodriver。 After downloading, extract it and make it executable(in linux chmod +x path/to/geckdriver
). 下载后,将其解压缩并使其可执行(在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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.