0
import requests
from bs4 import BeautifulSoup


url = f'https://gg.deals/games/?page=1'
response = requests.get(url, timeout=30)

Execution is not possible in an AWS Lambda environment where VPC configuration is not set up. Even after taking measures such as 'verify=False', 'timeout', and 'headers', the issue persists. I have also tried using HTTPAdapter and retry, but the same error keeps occurring. How can I resolve this?

equests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='gg.deals', port=443): Max retries exceeded with url: /games/?page=1 (Caused by ConnectTimeoutError(<urllib3.connection.HTTPSConnection object at 0x7f8bd08d39a0>, 'Connection to gg.deals timed out. (connect timeout=30)'))
helllllo
  • 1
  • 1
  • Can you connect to that with a browser or `curl` or `wget` from that same machine? If so, does the browser use a proxy? – Bruno Jun 16 '23 at 07:17
  • Even though there is no response in the local environment, the same error occurs in AWS Lambda. – helllllo Jun 16 '23 at 07:25
  • But does it work with an existing tool like `curl`? – Bruno Jun 16 '23 at 07:31
  • curl: (28) Failed to connect to gg.deals port 443 after 75008 ms: Operation timed out... It seems like the server has blocked me. – helllllo Jun 16 '23 at 07:33
  • just tested the code. works perfectly well for me. (`windows 11`, `python 3.11`)... so this is not a python code problem. But `AWS Lambda environment` issue... maybe repost with this or check AWS help for resolution. – D.L Jun 16 '23 at 09:26

0 Answers0