Rem 请手动添加引用 SeleniumBasic.tlb Option Explicit Private WD As SeleniumBasic.IWebDriverSub Baidu()On Error GoTo Err1Dim Service As SeleniumBasic.ChromeDriverServiceDim Options As SeleniumBasic.ChromeOptionsSet WD = New SeleniumBasic.IWebDriverSet Service = New SeleniumBasic.ChromeDriverServiceWith Service.CreateDefaultService driverPath:="D:\Chrome-Selenium".HideCommandPromptWindow = TrueEnd WithSet Options = New SeleniumBasic.ChromeOptionsWith Options.BinaryLocation = "D:\Chrome-Selenium\Chrome-bin\chrome.exe"End WithWD.New_ChromeDriver Service:=Service, Options:=OptionsWD.URL = "http://www.dpxq.com/hldcg/qishou_0_8.html"Dim table As SeleniumBasic.IWebElementDim trs() As SeleniumBasic.IWebElementDim tr As SeleniumBasic.IWebElementDim tds() As SeleniumBasic.IWebElementDim td As SeleniumBasic.IWebElementSet table = WD.FindElementsByTagName("table")(3)trs = table.FindElementsByTagName("tr")Dim i As IntegerFor i = 0 To UBound(trs)Set tr = trs(i)tds = tr.FindElementsByTagName("td")Set td = tds(1)Debug.Print td.TextNext iDim a As SeleniumBasic.IWebElementSet a = table.FindElementByLinkText("王天一")a.ClickExit Sub Err1:MsgBox Err.Description, vbCritical End SubSub Quit()WD.Quit End Sub