Chilkat.Http http = new Chilkat.Http();
http.UnlockComponent(”HTTP 30-day trial”);

// Make our HTTP client mimic Mozilla Firefox
http.MimicFireFox = true;

// Do not fetch from cache or save to cache.
http.FetchFromCache = false;
http.UpdateCache = false;

Chilkat.HtmlToXml conv = new Chilkat.HtmlToXml();
conv.UnlockComponent(”Html-to-Xml 30-day trial”);

// Get the HTML for a Yahoo! business news story:
conv.Html = http.QuickGetStr(”http://biz.yahoo.com/ap/060130/earns_exxon_mobil.html?.v=5″);

// Convert it to XML and load it into Chilkat XML.
Chilkat.Xml xml = new Chilkat.Xml();
xml.LoadXml(conv.ToXml());

// After converting to XML, the text is located entirely under
// “text” nodes. We don’t want anything under “script” sub-trees,
// so eliminate those by specifying “script” in the 2nd argument.
string pageText = xml.AccumulateTagContent(”text”,”script”);

textBox1.Text = pageText;

相关文章:

  • 2021-11-03
  • 2022-12-23
  • 2021-11-16
  • 2021-12-09
  • 2021-12-09
  • 2021-11-12
  • 2021-06-08
  • 2022-12-23
猜你喜欢
  • 2021-10-07
  • 2022-01-22
  • 2021-08-26
  • 2023-01-03
  • 2022-12-23
  • 2022-02-22
相关资源
相似解决方案