Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Download HTML Page in C#

Tags:

html

c#

url

I am writing an app in c#, Is there a way to download a HTML page by giving my program its URL only. Foe example my program will get the URL www.google.com and download the HTML page?

like image 463
yoni2 Avatar asked Aug 19 '11 08:08

yoni2


People also ask

How to download a webpage in Google Chrome?

How to Download a Webpage in Google Chrome. 1 Press the ‘Save page as…’ button. 2 Save the HTML file as a complete page, single file, or HTML only. 3 Open the saved Chrome webpage in your browser. 4 Access your saved web page in your downloads folder.

How to save a web page as a HTML file?

If you’re looking to do some offline viewing, you can save a web page in Chrome as a HTML file. When you save from Chrome using this method, you can choose to keep just the basic text to keep the file size low or download additional assets like pictures. The advantage of this method over saving a webpage as a pdf is the underlying code.

How do I download a web page in Visual Studio Code?

To find out, open up the project properties window, and go to the Configuration Properties -> General window. Notice what the “Character Set” field is set to. “Not Set” corresponds to using the ASCII character set. To download the web page, simply use the URLDownloadToFile function.

What is a webpage complete file?

– Webpage, Complete: Saves a HTML file as well as a separate folder that requires all of the files the website needs to function. Typically has the closest results to the original page.


1 Answers

Use WebClient.DownloadString().

like image 132
Bas Avatar answered Oct 08 '22 08:10

Bas