Answer the question
In order to leave comments, you need to log in
How to open https sites without trusted certificate without manual confirmation in firefox or phantomjs?
I am writing a script to simulate certain actions on a site with https without a trusted certificate. I use selenium+python+phantomjs/Firefox. PhantomJS doesn't want to render some https pages at all. Firefox throws an error, at best you have to manually acknowledge the exception.
Googled the solution to the problem, the proposed options did not help. Tell me how to be.
Answer the question
In order to leave comments, you need to log in
from selenium import webdriver
profile = webdriver.FirefoxProfile()
profile.accept_untrusted_certs = True
driver = webdriver.Firefox(firefox_profile=profile)
from selenium import webdriver
options = webdriver.ChromeOptions()
options.add_argument('--ignore-certificate-errors')
driver = webdriver.Chrome(chrome_options=options)
webdriver.PhantomJS("phantomjs", service_args=['--ignore-ssl-errors=true'])
You need to run PhantonJS with the option --ignore-ssl-errors=true Command Line Interface and it works and solves the problem (if the problem is with the certificate, of course). The fact that this is done through the options of the python driver itself does not mean at all that it starts PhantonJS with this option (you can usually check it through strace). I would recommend running PhantomJS from the command line with your hands and connecting from python to it.
I can’t say for Firefox right off the bat, but I suspect that it will be more difficult to do it there.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question