is
will return True
if two variables point to the same object. Where as ==
will return True
if the objects referred to by the variables are equal.
You can find a detailed relevan discussion in Is there a difference between "==" and "is"?
Solution
As a solution you can validate the string https://pepsi.fooji.com/?#choose-address
with in the string returned through driver.current_url
as follows:
if "https://pepsi.fooji.com/?#choose-address" in driver.current_url:
print(f"[{datetime.now()}] - Logged in!")
A optimal approach validate the partial string choose-address
with in the string returned through driver.current_url
as follows:
if "choose-address" in driver.current_url:
print(f"[{datetime.now()}] - Logged in!")