You can change the script, putting code in a loop:
You are creating the Browser object inside the login function. When it ends, it is eligible for garbage collection.
You can pass a pointer to an object outside the function, so it will still have a reference when the function ends.
driver = webdriver.Chrome(executable_path="C:\Program Files (x86)\chromedriver.exe",options=chrome_options);
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.common.by import By
WebDriverWait(driver,10).until(EC.element_to_be_clickable((By.XPATH,"xpath of drop down"))).click()
It will depend on what you want to tell in your code.
If you want to remove the text "end-bubble bubble", then you can use replace:
If you want to explicitly only take the last word of the string, you can use deconstruction:
_, _, last = service_status.split()
Or if you want to be more cryptic (don't ...
is css for contains and ^ start with for css
you can use any of the above locator to find the search field in linkedin
You can use partial matches with css selectors. So where you have id=ember26 above, in that case, you could use:
css=input[id^='ember'] (the ^ means starts with)
You can also use endswidth, and contains.
A great write up I found on all the different ways of handling dynamic cases will hopefully help.
Here is the ultimate solution specifically when you are dealing with Angular 7 or 8.
Instead of waiting for a longer duration using sleep or implicit wait methods, you can divide your wait time into the partition and use it recursively.
Below logic will wait for the page to render for a minimum of 300 seconds and a maximum of 900 seconds.
* This method ...