Closed tonyvu1289 closed 1 year ago
Sometimes the request will be timeout. This is the way i fix it.
from requests.adapters import HTTPAdapter from urllib3.util.retry import Retry session = requests.Session() retry = Retry(connect=3, backoff_factor=0.5) adapter = HTTPAdapter(max_retries=retry) session.mount('http://', adapter) session.mount('https://', adapter)
and then replace request.get() by session.get()
Hi @tonyvu1289, Thank you for sharing. Could you please provide further details on where and how we should utilize this code block?
Sometimes the request will be timeout. This is the way i fix it.
and then replace request.get() by session.get()