0

I had to add --ssl-protocl to make the command line script to work using phantomjs:

phantomjs --ssl-protocol=tlsv1 --debug=true phantom-server.js "http://example.com"

I would like to use it with selenium in Python, and tried the code shown below but no luck. I ran it in a shell but it stops at the line with .get(). Do I need to include some type of ssl protocol as was the case for running it in JS?

from selenium import webdriver
driver = webdriver.PhantomJS()
driver.set_window_size(1120, 550)
driver.get("https://example.com/")
driver.find_element_by_id('search_form_input_homepage').send_keys("realpython")
driver.find_element_by_id("search_button_homepage").click()
print driver.current_url
driver.quit()
4
  • are you saying that exact code? If you actually used that it would error on the first find_element_by_id Apr 14, 2016 at 17:38
  • I am running them on a shell and it gets stuck in the get() line.
    – Henry H
    Apr 14, 2016 at 18:24
  • the code above would error so that is probably what is happening Apr 14, 2016 at 18:25
  • You are right! It worked.
    – Henry H
    Apr 14, 2016 at 21:16

0