Dim lis As System.Windows.Forms.HtmlElementCollection = web.Document.GetElementsByTagName("div") '获得当前页面的A标签HTML元素集合 Dim count As Integer = 0 For Each li As object In lis If li.GetAttribute("ClassName") = "main-content" Then msgbox("找到类名为 main-content 的类") output.show(li.Innertext)