Click here to Skip to main content
15,887,596 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hi everybody,

I need to donwload an entire webpage using a Webview. I checked out the CapturePreviewToStreamAsync() method, but it catch only a preview of the part of the webpage I'm currently seeing (without scrolling down).

What I'm looking for is to download the entire webpage (complete of css, images and so on). I ahve a lot of ideas how to do it, but I'm missing the most important part: how to download the code behind for a webpage?

Thanks a lot!!

Jymmy097

EDIT:
I found what I was looking for: the HttpClient class.
Now, let's suppose I'm downloading the webpage and the related files and the user suspend the application... what will happen at that time??

Thanks!
Posted
Updated 21-Feb-14 8:58am
v2
Comments
ZurdoDev 21-Feb-14 14:38pm    
You can't get the codebehind for the web page. If you could, that would be a huge security risk.
LLLLGGGG 21-Feb-14 14:56pm    
I mean the HTML code the webpage generates... the one whoever can retrieve with its browser.
ZurdoDev 21-Feb-14 14:58pm    
The HttpClient is one way of doing it. There are lots of articles here on how to download a web page using C#.
LLLLGGGG 21-Feb-14 14:59pm    
And if the user suspends the application while I'm downloading the page?
ZurdoDev 21-Feb-14 15:05pm    
If they kill your app while it is downloading then I suppose it would kill that too. Perhaps you can explain better what it is your are trying to accomplish. Perhaps there is an alternative.

1 solution

Basically, this is a problem of Web scraping: http://en.wikipedia.org/wiki/Web_scraping[^].
One way, the most flexible one, is using the class HttpWebRequest. Please see my past answers:
get specific data from web page[^],
How to get the data from another site[^].

—SA
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900