mardi 27 novembre 2018

Is there any way to archive and recover entire page (with entire html, css, img, js, ...) using selenium chromedriver on ubuntu?

I'm looking for a way to archive the entire state of webpage, for the purpose of archiving the webpage.

Actually, what I want to somehow save all rendered results of the page (not as the form of screenshot, but the form of rendered result of DOM element) that we can see on browser, and recover them in local environment without network.

I really don't need to save all the functionalities of the page that interact with other computer. Only the view of the page is needed to be archived.

What I tried to archive youtube.com's home page were,

  1. Using beautiful soup to get immediate html sources
  2. Using python selenium and chromedriver to get dynamically loaded html sources
  3. 2 + downloading all referenced .css, .js, and images from links in html codes to local directory.
  4. Pressing ctrl+s on chrome, which downloads html sources and several files. (.js, .css, .jpg, ...)

But all of them did not work correctly.

At first, 4th method seems working, but soon I found out that it downloads initial html source, not a dynamically loaded one.

Is there any known ways to do this kind of stuffs? (archiving currently rendered state of the page)

Thanks in advance.




Aucun commentaire:

Enregistrer un commentaire