for example, set a judgment condition:
if requests.get(so_url,proxies=proxy,headers=headers).status_code == 200:
html = requests.get(so_url,proxies=proxy,headers=headers).text
url = re.search("<div class="img-box">.*?<a.*?href="(.*?)"><span>",html,re.S).group(1).replace("amp;","")
print(url)
else:
proxy = str(proxy).replace("{"http": "http://","").replace(""}","")
-sharp
how should this logic be designed?
calls this function directly under else at first, but then seems to have a memory overflow ?
then simply write the above judgment again under else, but can only try again.
the desired effect is that if you get to else, retry the judgment condition N times.