COZYHUB
  • Home
  • Disclaimer
  • Privacy Policy
  • About
  • Contact

How to get the entire web page source using Selenium WebDriver in python [duplicate]


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

1

Best Answer


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

from selenium import webdriverdriver = webdriver.Firefox()driver.page_source

Random Posts

Selection Sort PythonC: String functions without string.h libraryIn c, in bool, true == 1 and false == 0?how to give different linespecs for a plot of matrix in matlabPlot PCA loadings and loading in biplot in sklearn (like R's autoplot)firebase deploy --only functions overrides existing functionsThere was a general payment processing error. (result code = -12)getResourceAsStream returns nullExport arrays into xlsx using axlsx gemdisable swiping tabs in TabBar flutterundefined offset PHP errorHow to add System.Windows.Interactivity to project?How do I create a temporary directory in Python?Is there a way to create read only dashboard in Apache SupersetHow do I get the asdoc output table to show both the variable labels and value labels in Stata?UNIX export command [closed]Use value from other list in calculated column?Git pre-commit hook configurationIs there a way to use pure Javascript inside of Coffeescript?Fortify command line usage
Designed by COZYHUB