我正在尝试从一个网站获取HTML文档,还有什么,抓取数据!
不幸的是,我无法获得与该网页相关联的整个HTML文档。我的debug.print语句没有像我希望的那样显示整个网页,它被截断了。我是编程新手,如果能帮上忙,我将不胜感激!
我的代码如下:
Const SecForm4 As String = "https://www.secform4.com/significant-buys.htm"
Sub LoadWebPage()
Dim XMLReq As New MSXML2.XMLHTTP60
XMLReq.Open "GET", SecForm4, False
XMLReq.send
If XMLReq.Status <> 200 Or XMLReq.readyState <> 4 Then
MsgBox "Problem" & vbNewLine & XMLReq.Status & "-" & XMLReq.statusText
Exit Sub
End If
ParsingHTMLDocument XMLReq.responseText
End Sub
Sub ParsingHTMLDocument(HTMLText As String)
Dim HTMLDoc As New MSHTML.HTMLDocument
HTMLDoc.body.innerHTML = HTMLText
Debug.Print HTMLText
End Sub
https://stackoverflow.com/questions/51679384
复制相似问题