Back
I'm using Selenium Webdriver in Python.
While running the script in a headless browser(phantomjs) I'm getting an URLError:
<urlopen error [Errno 111] Connection refused>
Anyone can please help to handle this?
After doing some research, 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 am able to continue making requests. I suggest you use the same workaround.
If you are interested to learn Selenium on a much deeper level and want to become a professional in the testing domain, check out Intellipaat Selenium certification!
31k questions
32.8k answers
501 comments
693 users