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
187 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,170 points

Related Questions In Selenium

0 votes
1 answer

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

Its pretty simple. Check out the below ...READ MORE

answered Apr 5, 2018 in Selenium by nsv999
• 5,510 points
9,598 views
0 votes
1 answer

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

Normally WebDriver should return control to your ...READ MORE

answered Aug 23, 2018 in Selenium by Meci Matt
• 9,460 points
1,859 views
0 votes
1 answer

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

Simply Use this: driver.Manage().Window.Maximize(); READ MORE

answered Jun 7, 2018 in Selenium by Samarpit
• 5,850 points
5,171 views
0 votes
2 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
2,189 views
0 votes
1 answer

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,510 points
1,472 views
0 votes
1 answer
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,850 points
1,454 views
0 votes
1 answer

How to use such xpath to find web elements

It's much simpler to use: #MyDiv123 > div.super or ...READ MORE

answered Jun 14, 2018 in Selenium by Samarpit
• 5,850 points
1,217 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,170 points

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