Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/317.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用phantomjs和python执行重定向_Python_Python 3.x_Redirect_Phantomjs - Fatal编程技术网

使用phantomjs和python执行重定向

使用phantomjs和python执行重定向,python,python-3.x,redirect,phantomjs,Python,Python 3.x,Redirect,Phantomjs,您好,如果phantomjs和python3出现这种情况,我想跟踪重定向,但我无法让它工作,谷歌也没有帮助我 代码: from selenium import webdriver with open("test", "r") as t: br = webdriver.PhantomJS() for line in t.readlines(): br.get('http://{}'.format(line)) br.save_screenshot('./screens/{}.p

您好,如果phantomjs和python3出现这种情况,我想跟踪重定向,但我无法让它工作,谷歌也没有帮助我

代码:

from selenium import webdriver


with open("test", "r") as t:
br = webdriver.PhantomJS()
for line in t.readlines():
    br.get('http://{}'.format(line))
    br.save_screenshot('./screens/{}.png'.format(line))

br.quit()
信息:“test”是加载URL的文件


我不能截取子目录的屏幕截图,例如:google.com/help,但我也想要它

你想请求的网站是什么?这并不重要,只是重定向