摘要: 1、getElementById() getElementById()可以访问DOCUMENT中的某一特定元素,顾名思义,就是通过ID来取得元素,所以只能访问设置了ID的元素。 比如说有一个DIV的ID为docid:程序代码<div id="docid"></div>那么就可以用getElementById("docid")来获得这个元素。2、getElementsByName() 这个是通过NAME来获得元素,但不知大家注意没有,这个是GET ELEMENTS,复数ELEMENTS代表获得的不是一个元素,为什么呢? 因为DOCU 阅读全文
posted @ 2012-12-06 18:05 火荆棘 阅读(223) 评论(0) 推荐(0) 编辑
摘要: private delegate string DelegateGetDocument(); private string GetDocument() { return webCollection.Document.Body.InnerHtml; }*****************************************下面使用的是webbrowser抓取数据*****************************************HtmlAgilityPack.HtmlDocument document = ... 阅读全文
posted @ 2012-12-06 15:19 火荆棘 阅读(3594) 评论(0) 推荐(0) 编辑
摘要: webBrowser1.Document.GetElementById("kw").SetAttribute("value", this.textBox1.Text);webBrowser1.Document.GetElementById("sb").InvokeMember("click"); webmorenpaiming.Document.GetElementById("q").SetAttribute("value", keywords); //webmorenpai 阅读全文
posted @ 2012-12-06 15:08 火荆棘 阅读(292) 评论(0) 推荐(0) 编辑