6

I am using Selenium webdriver in Python for a web-scraping project.

How to print the HTML text of the selenium.WebElement ?

I intend to use the BeautifulSoup to parse the HTML to extract the data of interest.

Thanks

1 Answer 1

12

It's not possible to get the raw HTML from a WebElement.

You can get the page source from the browser object though: browser.page_source.

Sign up to request clarification or add additional context in comments.

1 Comment

This question I asked covers the same issue: stackoverflow.com/q/8258529/311220

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.