0

I'm working on a project for fun but i want to grab just the html code from a website which I will later have to extract just the links.

I've been googling for a few minutes and I haven't found anything that does what I want specifically (just the text).

1
  • 1
    I... can't.... resist... "specifically"! Commented Dec 8, 2009 at 21:01

4 Answers 4

6

What you want is the HTML Agility Pack

Sign up to request clarification or add additional context in comments.

2 Comments

I heard that will only work if the page i use as my target validates as html. is that true?
HTML Agility Pack is rather forgiving of malformed HTML - if it displays in a browser, the library can likely parse it.
4
WebClient client = new WebClient();
String htmlCode = client.DownloadString("http://born2code.net");

Comments

2

Have you looked at a standard tool like Httrack, or if you want to actually want the html if you're programming for fun look at WebClient or HttpWebRequest if you want to learn more.

Comments

0

This was helpful to me a while ago -- Parsing HTML in C#

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.