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
4,367 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 6, 2020 in Selenium by Sri
• 3,190 points
18,489 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 6, 2020 in Selenium by Sri
• 3,190 points
7,515 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 6, 2020 in Selenium by Sri
• 3,190 points
15,580 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 17, 2019 in Selenium by Tim Muir
9,302 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,500 points
12,715 views
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

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

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
8,608 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,910 points
6,684 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 3, 2020 in Selenium by Sri
• 3,190 points
7,551 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 13,238 views
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP