0

Don't know what else to say. running this code:

print (browser.current_url)
    if (str(browser.current_url) == "https://mail.google.com/mail/u/0/#inbox" or "https://mail.google.com/mail/u/0/"):
        return(1)
    else:
        return(2)

getting this output (note the browser.current_url printed in the output. it is clearly not equal to the two urls i am checking against in my if statement. what am I doing wrong ?

https://accounts.google.com/signin/v2/challenge/pwd?service=mail&passive=1209600&osid=1&continue=https%3A%2F%2Fmail.google.com%2Fmail%2Fu%2F0%2F&followup=https%3A%2F%2Fmail.google.com%2Fmail%2Fu%2F0%2F&emr=1&flowName=GlifWebSignIn&flowEntry=ServiceLogin&cid=1&navigationDirection=forward&TL=AM3QAYZBZ4vm-4uzG_xgo1LZsjRmi3HSgbrhl9NSrHuFs75WXOsSij23srG7s7HQ
1
  • 2
    Use `if browser.current_url in ("https:...","https:/..."):`. – Tim Roberts Feb 01 '22 at 03:55
  • Careful posting auth related url parameters into SO, they can have sensitive tokens etc. Nothing in your code prints out `1`. So update your question to include a complete , reproducible example. – erik258 Feb 01 '22 at 03:56
  • oh that one is just from a print return code statement that is in another function. – Pranshu Khare Feb 01 '22 at 03:59

0 Answers0