How To Get An 'nth-of-type' In Selenium
I'm using Selenium Webdriver to check the text of this particular paragraph (the one highlighted in blue here): But how do I 'query' that paragraph? This is what I'm trying (not w
Solution 1:
findElement()
is not a Python. Try below instead:
intro_text = hed_dek_wrapper.find_element_by_css_selector('p:nth-of-type(2)')
assert'Over the past 20 years, we have seen an evolution.' in intro_text.text
Post a Comment for "How To Get An 'nth-of-type' In Selenium"