Hello, we are producing a Python crawling program through the request module.
After starting crawling in the program you are designing, due to a network error, etc.
I wonder if there is an error in the repetitive sentence or if the program stops, it makes the repetitive sentence turn again at that point.
for z in range(len(excel_df1)):
try:
#CrawlingCode
except Exception as e:
write(e)
If len(excel_df1) is, for example, 5 when proceeding to a repeating statement like this, If there is a network error when z is 3, I want to start crawling again when it is 3 and finish I want to know how to do it!
python beautifulsoup
for z in range(len(excel_df1)):
count = 0
while 1:
try:
#CrawlingCode
break
except Exception as e:
write(e)
count += 1
if count > 2:
break
© 2024 OneMinuteCode. All rights reserved.