【发布时间】:2014-12-22 22:29:04
【问题描述】:
我找不到如何使用 --cookies-file=/path/to/cookies.txt 等命令行选项启动 phantomjs...
试过driver = webdriver.PhantomJS('--cookies-file=/tmp/ph_cook.txt'),但没有。
由于未知原因add_cookie 无法保持登录状态。
我尝试像这样启动 phantomjs:
driver = webdriver.PhantomJS(executable_path = "phantomjs --cookies-file=/tmp/ph_cook.txt --webdriver")
但出现错误:
raise WebDriverException("Unable to start phantomjs with ghostdriver.", e)
selenium.common.exceptions.WebDriverException: Message: Unable to start phantomjs with ghost driver.
【问题讨论】:
-
@SiKing 语言错误,但我还没有找到重复的。不过一定有。
-
@ArtjomB。都是 Selenium,语言绑定不重要?
标签: python selenium cookies webdriver phantomjs