Answer the question
In order to leave comments, you need to log in
Problem with requests. How to fix an infinite get request?
With a normal get request, it works fine:
import requests
url = 'https://www.versace.ru'
response = requests.get(url=url)
import requests
r = 0
while r<2:
url = 'https://www.versace.ru'
response = requests.get(url=url)
r += 1
Answer the question
In order to leave comments, you need to log in
An infinite request usually turns out if there is an except inside that silences errors and because of which the r increment does not occur, you didn’t show us all the code, did you?
And instead, it's better to use and with a successful response, do break while r<2:
for _ in range(2)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question