每次服务器禁止我的ip(60秒钟)时,getid()方法都会给出一个nontype错误。我希望每次遇到错误时都要重复循环实例,以免遗漏任何项目。我该如何完成?
for t in soup.find_all("div",{"class":"vItem Normal"}):
try:
if(t["data-exterior"]=="Not Available"):
continue
name.append(t["data-hashname"])
id_parse=requests.get(f"http://steamcommunity.com/market/listings/730/{name[-1]}")
item_id=getid(id_parse.text)
skin_ids[name[-1]]=item_id
sleep(3)
except:
sleep(60)
#i want to reiterate now