So, I am very unfamiliar with the "try" and :except" code lines and I am unsure if I am doing this correctly, but this is where I am.
try:
code a
#
except Exception:
code b
#
except:
code c
So, what I am trying to do is for the browser to try "code a", and if "code a" is not found, then try "code b". If there is an easier way of doing this, please let me know. "code c" is the last line of code that I want to run after it has found either "code a" or "code b". Both "code a" and "code b" have browser.refresh() in it, of which I want it to keep refreshing the page until either "code a" or "code b" finds what it is looking for. But, when it does not find what it is looking for, it refreshes the page but says "Process finished with exit code 0" and not refreshing the page and restarting the script over again. It is supposed to search the page and if it does not find what it is looking for, refresh the page and try again until it finds it and then it continues to "code c". I have also tried "finally", but instead it continues to the "finally" before "code a" and "code b" actually find what it is looking for.
I have also tried this.
try:
code a
except Exception:
pass
#
try:
code b
except Exception:
pass
#
try:
code c
except Exception:
pass
Neither of these worked or me, they kept finishing the process without trying until it found either "code a" or "code b".
Any help would be great!
Thanks in advance!