I am currently trying to parse an HTML page. While doing so, I have to perform
- Search a specific string and do some steps. (if this operation fails, go to step b)
- Search a specific string using a different code and do some steps. (if this operation fails, go to step 3)
- Search a specific string using a different code and do some steps.
I am doing like this and my question is if I have to try multiple times, how to specify try and except.
try:
#step 1
except: # ( not sure what kind of error will execute step2)
#step 2
except:
#step 3
thanks