Problem: I'm building a software using selenium which:
- goes to a web page (a search page).
- searches a term
- the items get added to the search page dynamically
- clicks on the first item
- a pop up body happens with more info on that item which is a dynamic html added to the source
- saves the info
- Now I want to get out of that pop up, by clicking on an exit
<button>
usingdriver.find_element_*
can't find the element without refreshing the page, because it was added to the page.
I've tried:
- first try
WebDriverWait(driver,10).until(EC.element_to_be_clickable((By.CLASS_NAME, 'the class of the element')))
and
WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.CLASS_NAME, 'class name')))
driver.page_source
3.second try : combination of both
WebDriverWait(driver,10).until(EC.element_to_be_clickable(By.CLASS_NAME, 'the class of the element'))
driver.page_source
In the case of wait().until()
; I don't find the button element even though I can see it in the browser, till I get timed out.
Thank you in advanced.
EDIT: the website is upwork.com job search