I am trying to search for an element in a sub-element with Selenium (Version 2.28.0), but selenium des not seem to limit its search to the sub-element. Am I doing this wrong or
This is how you search for element or tag in CSS subclass and I believe that it works for multilevel situation as well:
Sample HTML:
Posted: 22.03.2019 u 09:46
This is how you would get pubdate tag value for example.
pubdate
published = driver.find_element_by_css_selector('li>time').get_attribute('datetime')