Python / Selenium: Logic Operators in WebDriverWait Expected Conditions -
i'm using python / selenium submit form have web driver waiting next page load using expected condition using class id.
my problem there 2 pages can displayed not share unique element (that can find) not in original page. 1 page has unique class of mobile_txt_holder
, other possible page has class id of notfoundcopy
. i use wait looking mobile_txt_holder
or notfoundcopy
appear.
is possible combine 2 expected conditions 1 wait?
basic idea of looking won't work:
webdriverwait(driver, 30).until(ec.presence_of_element_located((by.class_name, "mobile_txt_holder"))) or .until(ec.presence_of_element_located((by.class_name, "notfoundcopy")))
i need program wait until next page loads can parse source.
sample html:
<p class="notfoundcopy">unfortunately, number entered not in our tracking system.</p>
apart clubbing 2 expected_conditions
through or
clause, can construct css
take care of our requirement following css
either ec either in mobile_txt_holder
class or in notfoundcopy
class:
element = webdriverwait(driver, 10).until( ec.presence_of_element_located((by.css_selector, ".mobile_txt_holder, .notfoundcopy"))
Comments
Post a Comment