The following HTML code is as proceeds:
<div class="lower-text">
<div data-text="winScreen.yourCodeIs">Your Code Is:</div>
<div>GENERATEDCODE</div>
What I'm trying to access is the second div node (the randomly generated number) in the class "lower-text"
try:
element = WebDriverWait(browser, 10).until(
EC.visibility_of_element_located((By.CLASS_NAME, 'lower-text'))
)
finally:
found = browser.find_element_by_xpath("//a[@class='lower-text'][2]").text
print(found)
This is what I've tried with no success. I am unsure as how to access the second div node. Any help would be appreciated.