【发布时间】:2018-01-28 20:43:55
【问题描述】:
是否可以将使用 Selenium(使用 Excel VBA)抓取的 HTML 源存储到 HTMLDocument 元素中?
这是一个使用 Microsoft Internet Controls 和 Microsoft HTML Object Library 自动化 Internet Explorer 的示例。
Dim IE as InternetExplorer
Dim HTML as HTMLDocument
Set IE = New InternetExplorer
ie.navigate "www.google.com"
set HTML = IE.Document
Selenium 的圆顶也可以吗?例如(不工作!):
Dim selenium As SeleniumWrapper.WebDriver
Set selenium = New SeleniumWrapper.WebDriver
Dim html as HTMLDocument
selenium.Start "firefox", "about:blank"
selenium.Open "file:///D:/webpages/LE_1001.htm"
Set html = selenium.getHtmlSource 'this is not working since .getHtmlSource()
'returns a String object but is there a way to store
'this html source into a type of HTMLDocument-element
【问题讨论】:
标签: html vba excel selenium xhtml