14

I am using Selenium WebDriver in python, and I would like to retrieve in a variable the entire page source of the web page (something like the right click option that many web browsers provide to get the page source).

Any help is appreciated

0

1 Answer 1

32

Your WebDriver object should have a page_source attribute, so for Firefox it would look like

from selenium import webdriver
driver = webdriver.Firefox()
driver.page_source
Sign up to request clarification or add additional context in comments.

1 Comment

thats not view source code

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.