到目前为止,我已经得到了这个。只有Chrome浏览器打开(这是空的)&它没有考虑到网址。我应该对Shell脚本做出哪些更改?
Sub ViewSource()
Dim chromePath As String
chromePath = """C:\Program Files\Google\Chrome\Application\chrome.exe"""
Shell (chromePath & "view-source:http://search.yahoo.com/search;_ylt=A0oGdXgbd8FQJXoAuj6l87UF?p=cars%20parts&fr=sfp&pqstr=car%20parts")
End Sub
谢谢!
答案 0 :(得分:0)
我在cmd提示符下的Chrome.exe上尝试了很多不同的标志,但是没有正常工作。
但是你可以这样得到源代码:
Sub t()
GetSource "http://search.yahoo.com/search;_ylt=A0oGdXgbd8FQJXoAuj6l87UF?p=cars%20parts&fr=sfp&pqstr=car%20parts"
End Sub
Function GetSource(url As String) As String
With CreateObject("MSXML2.XMLHTTP")
.Open "GET", url
.Send
Do: DoEvents: Loop Until .Readystate = 4
GetSource = .responsetext
.abort
End With