首页 > Web开发 > 详细

使用selenium+firefox做网站下载文件

时间:2018-07-24 12:22:39      阅读:746      评论:0      收藏:0      [点我收藏+]
环境:centos el7.x86_64系统+python2.7.5+selenium 3.13.0+geckodriver_0.21.0+firefox_60.1.0

问题:使用browser.execute_script("window.open(url)")
新链接无法使用新标签窗口

解决:使用browser.execute_script("window.open(url,‘_self‘)") 在本页面打开新链接
依然存在问题:SessionNotCreatedException: Message: Tried to run command without establishing a connection

                 改变js的方法:browser.execute_script("window.location.href=url")

使用selenium+firefox做网站下载文件

原文:http://blog.51cto.com/13884757/2149392

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!