1

I am trying to read webpage text by using Xml Document:

XmlDocument document = new XmlDocument();
string site = "https://emailhunter.co/search/a-bs.com";
document.Load(site);
string allText = document.InnerText;

This is the exception i get:

An unhandled exception of type 'System.Xml.XmlException' occurred in System.Xml.dll Additional information: The ';' character, hexadecimal value 0x3B, cannot be included in a name. Line 5, position 383.

I really don't understand what's wrong here. If you can give me some tips, I would really appreciate it.

jrbedard
  • 3,662
  • 5
  • 30
  • 34
Petar Mijović
  • 337
  • 3
  • 15

1 Answers1

0

You can use the Html Agility Pack like written in this post: What is the best way to parse html in C#?

Community
  • 1
  • 1
Mathias Müller
  • 303
  • 3
  • 12