Private HTTPstr(1 To 200) As String, I As Integer, J As Integer
Private HTP As String, HHTP As String
Dim aaa As StringPrivate Sub Command1_Click()
Dim web As New CNoUIFsBrowser
J = 1 For J = 1 To I - 1
HTP = HTTPstr(J)
HHTP = "HTTP://www." & HTP ' url = "http://www.baidu.com"
' Shell "explorer " & url, 0 web.Navigate HHTP
aaa = reg.GetSingleSubValue(web.ResponseText, "<title>(.*)</title>")
If aaa = "" Then
HHTP = "HTTP://www." & HTTPstr(J)
web.Navigate HHTP
aaa = reg.GetSingleSubValue(web.ResponseText, "<title>(.*)</title>")
End If
Text1.Text = Text1.Text & HTTPstr(J) & vbCrLf & aaa & vbCrLf
Debug.Print "aaa = " & aaa
Next J
End SubPrivate Sub Form_Load()
Dim iStr() As String I = 1
Open "C:\Documents and Settings\Xia\桌面\3.txt" For Input As #1 Do While Not EOF(1) Line Input #1, lineStr HTTPstr(I) = lineStr
Debug.Print HTTPstr(I)
I = I + 1 Loop Close #1End Sub其中 3.TXT 中 是
0101mobile.com
0538sj.com
0580sj.com
0592shop.com
0599sj.com
0731mobile.com
0731sj.net
0735cs.org.cn
0751sj.com
0756sj.cn
0756sj.com
0760sj.net
0795shop.com问题
1 非常慢 非常卡.
2 http://0592shop.com/ 取不到.
能不能在
web.Navigate HHTP
那里加个什么判断. 多久还没读出来的话. 就放弃了..
我正在用100条左右测试. 读不出来的很少. 问题2可以忽略了.
不知道那 xmlHttp 是个什么东西啊 - -
Dim ArrayUrl$(2), i%, GetUrl$, GetName$
Public Sub Command1_Click()
If i <= UBound(ArrayUrl) Then
Form1.WebBrowser1.Navigate ArrayUrl(i): i = i + 1
Else
MsgBox GetUrl '地址
MsgBox GetName '标题
End If
End SubPrivate Sub Form_Load()
ArrayUrl(0) = "www.baidu.com"
ArrayUrl(1) = "www.google.com"
ArrayUrl(2) = "www.bing.com"
End SubPrivate Sub WebBrowser1_DocumentComplete(ByVal pDisp As Object, URL As Variant)
If URL = "about:blank" Then Exit Sub
GetName = GetName & Form1.WebBrowser1.LocationName & vbCrLf
GetUrl = GetUrl & URL & vbCrLf: Call Form1.Command1_Click
End SubPrivate Sub WebBrowser1_DownloadBegin()
Form1.WebBrowser1.Silent = True
End SubPrivate Sub WebBrowser1_DownloadComplete()
Form1.WebBrowser1.Silent = True
End Sub
获取页面源代码用xmlhttp啊
Dim XmlHttp As Object
Set XmlHttp = CreateObject("Microsoft.XMLHTTP")XmlHttp.Open "GET", "http://www.google.cn", False
XmlHttp.sendMsgBox StrConv(XmlHttp.responseBody, vbUnicode)Set XmlHttp = Nothing