I can't find how to start phantomjs with command-line options like --cookies-file=/path/to/cookies.txt
and other...
Tried driver = webdriver.PhantomJS('--cookies-file=/tmp/ph_cook.txt')
but nothing.
For unknown reason add_cookie
don't work to keep logged.
I tried to start phantomjs like this:
driver = webdriver.PhantomJS(executable_path = "phantomjs --cookies-file=/tmp/ph_cook.txt --webdriver")
but getting error:
raise WebDriverException("Unable to start phantomjs with ghostdriver.", e)
selenium.common.exceptions.WebDriverException: Message: Unable to start phantomjs with ghost driver.
You can pass commandline arguments to the PhantomJS instance behind the scenes by passing them as a list to the service_args
argument:
webdriver.PhantomJS(service_args=['--cookies-file=/tmp/ph_cook.txt'])
If the driver cannot be started then the language bindings are probably not able to determine the location of the PhantomJS executable properly. You may need to additionally pass the complete path to the executable_path
argument. Note that if you installed PhantomJS through npm, the actual executable is not directly in the global package directory but in a subfolder of it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With