Answer the question
In order to leave comments, you need to log in
Selenium Python how to get tags with content that is in a tag?
Hello!!! I encountered such a problem when parsing, well, I don’t know all the functionality of Selenium.
<div class="main">
<div class="wrapper">Содержимое тэга</div>
<div class="class">Содержимое тэга</div>
</div>
<div class="wrapper">Содержимое тэга 1</div>
<div class="class">Содержимое тэга 2</div>
driver.find_element_by_xpath("//body//div//div[@class='main']").text
Answer the question
In order to leave comments, you need to log in
Maybe so:
driver.find_element_by_xpath("//body//div//div[@class='main']").get_attribute('innerHTML')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question