How to save the content on the page (full page) using Selenium WebDriver?

0 votes

I was thinking about what is the best way to save all the files that are retrieved when you test an application using Selenium. In other words, I would say, when Selenium visits www.edureka.co I want to save HTML, JavaScript (including scripts referenced in src tags), images, and the content contained in the iframes. How can this be done?

I know this method getHTMLSource() will return the HTML content in the body of the mainframe, but how can this be extended to download the complete set of files that are necessary to render that page all over again?

Jun 28, 2019 in Selenium by Surya
• 970 points
499 views

1 answer to this question.

0 votes

Selenium isn't designed to do this, you could either follow this:

  1. Use getHtmlSource and parse the resulting HTML for references to external files, which you can then download and store it in a folder.
  2. Use something other than Selenium to download and store an offline version of a website, Pretty sure there are plenty of tools that could do this if you know what to search.

Hope this helps:)

answered Jun 28, 2019 by Vaishnavi
• 1,180 points

Related Questions In Selenium

0 votes
2 answers

How to scroll the Page up or down in Selenium WebDriver? (using java)

JavascriptExecutor jsx = (JavascriptExecutor)driver; jsx.executeScript("window.scrollBy(0,555)", ""); or Action classes ...READ MORE

answered Sep 5 in Selenium by Sri
• 2,970 points
13,867 views
0 votes
2 answers

How to know the exact time to load a page using Selenium WebDriver?

long start = System.currentTimeMillis(); driver.get("Some url"); long finish = ...READ MORE

answered Sep 5 in Selenium by Sri
• 2,970 points
4,198 views
0 votes
2 answers

How to open a browser window in full screen using Selenium WebDriver with C#

Hi , we have inbuilt method Maximize(). driver.Manage().Wind ...READ MORE

answered Sep 5 in Selenium by Sri
• 2,970 points
10,330 views
0 votes
3 answers

How to set Page Load Timeout using C# using Selenium WebDriver

driver.Manage().Timeouts().PageLoad = TimeSpan.FromSeconds(15); READ MORE

answered Apr 16, 2019 in Selenium by Tim Muir
4,873 views
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,520 points
4,034 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31 in Selenium by Sri
• 2,970 points
4,981 views
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,890 points
2,921 views
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 2 in Selenium by Sri
• 2,970 points
3,355 views
0 votes
1 answer

How to auto-refresh the ChromeDriver using Selenium Webdriver?

You can use this command. Also, refresh ...READ MORE

answered May 10, 2019 in Selenium by Vaishnavi
• 1,180 points

edited May 10, 2019 by Omkar 6,057 views
0 votes
1 answer