Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getting URLError: <urlopen error [Errno 111] Connection refused> in selenium webdriver using python in phantomjs

I'm using Selenium Webdriver in Python.

While running the script in headless browser(phantomjs) I'm getting an URLError:

<urlopen error [Errno 111] Connection refused> 

Any one can please help to handle this?

like image 330
user3172334 Avatar asked Jan 10 '14 11:01

user3172334


1 Answers

Having Googled this, it seems to happen unpredictably but after I've made a few requests with Selenium / Phantom. If I create a new webdriver with driver = webdriver.PhantomJS() then I'm able to continue making requests. I suggest others use the same workaround.

like image 153
hcarver Avatar answered Oct 12 '22 05:10

hcarver