goo*_*oof 5 python cookies selenium webdriver phantomjs
我找不到如何使用命令行选项启动phantomjs --cookies-file=/path/to/cookies.txt和其他...
试过driver = webdriver.PhantomJS('--cookies-file=/tmp/ph_cook.txt')但没什么.
由于未知原因add_cookie,不能保持记录.
我试着像这样开始幻影:
driver = webdriver.PhantomJS(executable_path = "phantomjs --cookies-file=/tmp/ph_cook.txt --webdriver")
Run Code Online (Sandbox Code Playgroud)
但得到错误:
raise WebDriverException("Unable to start phantomjs with ghostdriver.", e)
selenium.common.exceptions.WebDriverException: Message: Unable to start phantomjs with ghost driver.
Run Code Online (Sandbox Code Playgroud)
您可以通过将命令行参数作为列表传递给参数,将命令行参数传递给后台的PhantomJS实例service_args:
webdriver.PhantomJS(service_args=['--cookies-file=/tmp/ph_cook.txt'])
Run Code Online (Sandbox Code Playgroud)
如果无法启动驱动程序,则语言绑定可能无法正确确定PhantomJS可执行文件的位置.您可能还需要将完整路径传递给executable_path参数.请注意,如果您通过npm安装了PhantomJS,则实际的可执行文件不是直接在全局包目录中,而是在其子文件夹中.
| 归档时间: |
|
| 查看次数: |
2778 次 |
| 最近记录: |