|
楼主 |
发表于 2015-1-13 12:54
|
显示全部楼层
本帖最后由 onlycxb 于 2015-1-13 12:58 编辑
分享:[url]http://list.yhd.com/c33797-0-0/[/url]- Sub t()
- Dim Xml As Object, html As Object
- Dim Url As String, S As String
- Dim tb As Object, i As Long
- Url = "http://list.yhd.com/searchPage/c33797-0-81144/b/a-s1-v0-p2-price-d0-f0-m1-rt0-pid-mid0-k"
- Set html = CreateObject("htmlfile")
- With CreateObject("MSXML2.XMLHTTP")
- .Open "GET", Url, False
- .send
- S = .responseText
- S = Replace(S, "\r", "")
- S = Replace(S, "\n", "")
- S = Replace(S, "\t", "")
- S = Replace(S, "", "")
- html.body.innerhtml = S
- End With
- Set tb = html.all.tags("a")
- For i = 0 To tb.Length - 1
- If tb(i).classname = "title" Then
- Debug.Print tb(i).innertext
- Debug.Print Split(Split(tb(i).outerHtml, "href=""")(1), """ target=_blank pmId")(0)
- End If
- Next i
- End Sub
复制代码 |
|