I'm trying to connect to a website with the code below. There is no problem on Heroku. But I am getting error in DigitalOcean.
Code:
headers = {"User-Agent":"Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36"}
def web():
rq = requests.get("https://myurl.com/gts?search=word", headers = headers)
print(rq)
The error I get in DigitalOcean:
HTTPSConnectionPool(host='myurl.com', port=443): Max retries exceeded with url: /gts?search=word (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7fa364a89690>, 'Connection to myurl.com timed out. (connect timeout=None)'))
What I've done and failed:
I added code verify=False, disabled firewall from console. And I tried to access the site from the console with the "curl -I myurl.com" command. All failed.
Thank you for your help.