vba下selenium Chrome 无头模式抓取Mtime新闻示例代码

vba下selenium Chrome 无头模式抓取Mtime新闻示例代码
Sub qwe()
Dim driver As New ChromeDriver, post As Object
With driver
.AddArgument "--headless" ''This is the fix
.Get "http://news.mtime.com"
End With

For Each post In driver.FindElementByClass("newscontent").FindElementsByTag("h4")
Debug.Print (post.Text)
Next post

End Sub

猜你喜欢

转载自blog.51cto.com/4432704/2547511