【发布时间】:2015-09-01 09:30:29
【问题描述】:
我正在尝试从以下 URL 中抓取数据。但是当driver.get(url) 时,selenium 会失败,有时错误是[Errno 104] Connection reset by peer,有时是[Errno 111] Connection refused。 在极少数情况下它工作得很好,在我的带有真正浏览器的 mac 上,同一个蜘蛛每次都能正常工作。所以这与我的spider 无关。
尝试了许多解决方案,例如在页面上等待选择器、隐式等待、使用 selenium-requests 来传递正确的请求标头等。但似乎没有任何效果。
http://www.snapdeal.com/offers/deal-of-the-day
https://paytm.com/shop/g/paytm-home/exclusive-discount-deals
我正在使用python、selenium 和headless Firefox webdriver 来实现这一点。操作系统是centos 6.5。
注意:我有很多 AJAX 被成功抓取的重页,下面是一些。
http://www.infibeam.com/deal-of-the-day.html, http://www.amazon.in/gp/goldbox/ref=nav_topnav_deals
已经花了很多天试图调试这个问题,但没有成功。任何帮助将不胜感激。
【问题讨论】:
标签: python selenium selenium-webdriver httplib centos6.5