"Save as" from a web page

Let me tell you my problem:
When I download a web page with the following command:
download.file("url-of-website", "path-destination")

This one returns me the source code of the page. So far, no problem.
However, when I go on the page in question and that I make "save as" and that I download the html page on my pc, that displays me a quite other code, much more interesting.
So I wanted to know if it is possible not to download the "source code" but to download the same file as when I "save as".

Of course the goal is to automate the procedure...

Thanks for your help!

Cordially, Mani


Could you provide an example of a web page where this is the case? Because if I try to get html from saving it through chrome or with R I got the same result.


Thanks for your answer.
It happens when the website owner wants to hide data. He uses js functions that will "hide" the html code in question.
I have however succeeded using the "RSelenium" library and with the following commands:

 driver<- rsDriver()
  remDr <- driver[["client"]]
  remDr <- remoteDriver(remoteServerAddr = "localhost", 
                        port = 4567, 
                        browserName = "firefox"
      source <- remDr$getPageSource()[[1]]

This allows you to retrieve the source code of a page executed in js !
Problem solved

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.