【发布时间】:2013-08-06 15:01:50
【问题描述】:
我正试图让这个简单的代码到达 Internet。我在代理服务器后面,但我设置了 http_proxy、https_proxy 和 no_proxy 环境变量。
Python 代码:
from selenium import webdriver
driver = webdriver.PhantomJS()
driver.get('http://www.google.com')
driver.page_source
输出:
u'<html><head><title> Web Authentication Redirect</title><meta http-equiv="Cache-control" content="no-cache"><meta http-equiv="Pragma" content="no-cache"><meta http-equiv="Expires" content="-1"><meta http-equiv="refresh" content="1; URL=https://1.1.1.1/login.html?redirect=www.google.com/"></head><body>\n</body></html>'
关于如何解决这个问题的任何想法?
另外,我使用的是 Ubuntu 12.04 LTS。
【问题讨论】:
标签: python proxy selenium-webdriver web-crawler phantomjs