采集网页的几个问题
我是先把网页用HttpWebRequest读出网页的源代码,再把原代码转成WebBrowser.document
现在有两个问题
1.当程序第一次采集的时候采不到我需要的内容,但在webbrowser里网页显示正常
document里显示的连接数也正常,但在判断我需要的连接为0
2.以下是采级的主控制代码
Dim filepath = "c:\1.txt"
getPage("http://www.clickbank.com/marketplace.htm?" & "method=Sort&c=1&subc=2&keywords=&sortBy=popularity&billingType=ALL&locale=EN&i=50", "c:\1.txt")
While weburl1 <> ""
filepath = "c:\" & weburl1.substring(weburl1.LastIndexOf("=") + 1) & ".txt"
MsgBox(filepath & "," & weburl1)
getPage(weburl1, filepath)
End While
MsgBox("采集完成")
getpage我是写的一个采集网页的方法
这个代码通过while采集多个网页
如果注释掉红字部分的时候采集到第二个网页就不动了,也不报错,程序就假死了
如果不注释的话就能正常采集下去
请问各位大大是哪里的问题啊