这个容易,一会把代码写好发附件
追问能麻烦您将具体的使用过程截图发给我吗?
不是编程专业毕业的,怕不会用
谢谢
追答不会没关系的,只要下载附件,然后将你的网址按照A2的格式放到A列,然后运行宏aa就行了。
我这边测试正常,可能你的浏览器版本什么的会产生误差,你先试试,不行我再修改。
当然前提是,你的每个网页都是一样的格式,否则就比较麻烦了。
![](https://video.ask-data.xyz/img.php?b=https://iknow-pic.cdn.bcebos.com/472309f790529822c43289a3d4ca7bcb0a46d449?x-bce-process=image%2Fresize%2Cm_lfit%2Cw_600%2Ch_800%2Climit_1%2Fquality%2Cq_85%2Fformat%2Cf_auto)
为了方便其他人搜索讨论,我也把代码贴上来,下面的你可以不用理会。
Sub aa()
On Error Resume Next
For rws = 2 To [A65536].End(xlUp).Row 'A列放网址
With CreateObject("internetexplorer.application") '新建一个ie页
.Visible = True
.Navigate Cells(rws, 1) '浏览某个页面
Do Until .ReadyState = 4
DoEvents
Loop '等到页面载入完全
Set r = .Document.All.tags("span") '获取span标签的数量
'---以下分别读取对应字段内容--
Cells(rws, 2) = Mid(r(16).innerText, 4, Len(r(16).innerText) - 3)
Cells(rws, 3) = r(20).innerText
Cells(rws, 4) = r(25).innerText
Cells(rws, 5) = r(28).innerText
Cells(rws, 6) = r(31).innerText & r(32).innerText & r(33).innerText
Cells(rws, 7) = r(39).innerText
Cells(rws, 8) = r(47).innerText
Cells(rws, 9) = r(57).innerText
'--------------------------
.Quit
End With
Next rws
End Sub
本回答被提问者采纳