Timeout error when trying to get a https website with Python+Selenium

September 11, 2018 1.7k views
Python Ubuntu 18.04

I am trying to use Python + Selenium to login to some website and parse information. I want this project to be hosted at a droplet.
When I try to access the website in headless mode, Selenium drivers just load empty pages. Besides, I tried to use xvfb and pyvirtualdisplay to run non-headless mode. In this case, I got a Chrome error page stating that Chrome can’t connect to a network.
I disabled ufw, removed all IPTABLES rules. Interesting fact is that when I use Firefox driver in headless mode, I get a Timeout error.
On my PC I am able to run the same code using same settings and selenium drivers and access the website.
So the question is: Are there any network restrictions for DigitalOcean droplets? Why am I running into Timeout errors? Thanks

1 Answer

Hey friend!

There are no network restrictions that we deploy on our side that would cause this, but I’m afraid I don’t know what is causing it for you. It could be that the website in question is blocking datacenter IPs, or even just our IP space.


  • I found out that I am not able to access https://booking.uz.gov.ua/ even with Python Requests.

    import requests
    r = requests.get(’https://booking.uz.gov.ua/’)
    This code throws TimeoutError: [Errno 110] Connection timed out.
    But I am able to run this code at my local PC and it returns a successful response.
    Besides, when I use a proxy server with python requests, I can access website too.

Have another answer? Share your knowledge.