如何抓取网页抓取工具中display-none-tag的内容/文本?

时间:2014-04-09 03:12:03

标签: c# fizzler

我正在使用WebClient [c#]

WebClient client = new WebClient();
client.Encoding = Encoding.UTF8;
var response = client.DownloadString("http://www.iryoucai.com/PositionDefault_069.html");
var doc = new HtmlDocument();
HtmlDocumentExtensions.LoadHtml2(doc, response);
var docNode = doc.DocumentNode;
var emailNode = docNode.QuerySelector("#positionEamil");//this is a span with display=none, actually contains c-hr@cg.com.cn
Console.WriteLine(emailNode.InnerText);// output ' '

Fizzler抓取某个域中的某些网页;但是一个烫手山芋到我手中:如果html源代码包含一个显示样式为none的标签,那么我不会得到该标签的内容/文本,任何想法?提前谢谢!

0 个答案:

没有答案