I am trying to access the text of multiple tags using selenium in python.
The tags do not have attribute like id or class; they have an attribute named itemprop.
For instance there are multiple tags of such type:
<p itemprop="articleBody">
London's Gatwick Airport ........</p>
I can't use "select element by tag name" because there are tag "p" with different attributes which I don't want to include.
I am using the below code to select these elements:
elements = driver.find_element(By.CSS_SELECTOR, """p[itemprop='articleBody’]""")
However it throws the error - ......
NoSuchElementException: Message: no such element: Unable to locate element: {"method":"css selector","selector":"p[itemprop='articleBody’]"}
How can I fix this?