Reputation: 2572
I currently am having difficulty extracting text from the following page:
I have tried browser.find_element_by_class_name("W6bZuc.YMllz").text
and also
browser.find_element_by_tag_name("h3").text
but these all come up empty. Is there a way to get the h3
element consistently using selenium webdriver in python? Thanks.
Upvotes: 0
Views: 880
Reputation: 7563
Try use .get_attribute('innerHTML')
:
driver.find_element_by_css_selector('.W6bZuc.YMllz').get_attribute('innerHTML')
Upvotes: 1
Reputation: 14135
Try getting textContent
browser.find_element_by_class_name("W6bZuc.YMllz").get_attribute("textContent")
Upvotes: 1