Webページを解析しようとしています。しかし、それはエラーを出しています。私を助けてください。ありがとう。
コードは次のとおりです。
static void myMain()
{
using (var client = new WebClient())
{
string data = client.DownloadString("http://www.google.com");
HtmlDocument doc = new HtmlDocument();
doc.LoadHtml(data);
var nodes = doc.DocumentNode.SelectNodes("//a[@href]");
foreach (HtmlNode link in nodes)
{
HtmlAttribute att = link.Attributes["href"];
Console.WriteLine(att.Value);
}
}
}
The type 'System.Windows.Form.HtmlDocument' has no constructors defined.
HAPを含めたというエラーが発生しています。
ありがとう