繁体   English   中英

用Javascript将HTML页面刮到Excel中

[英]Scrape HTML page with Javascript into Excel

希望你们中的一个可以在这里帮助我。 我正在尝试从此网页以及其他相同网站的数据导入excel: https ://re.po.st/qZZYQJ-基本上,我想获取总点击数:322,627并将其包含在Excel中网址旁边的一列。 我尝试在Google电子表格中使用importhtml和importxml,但无法正常工作。 我相信是因为此元素是用javascript呈现的? 有谁知道如何获得这个元素? 有没有我可以使用的VBA代码。 我不是技术含量最高的人,因此如果我监督某些事情,我深表歉意。

麦克风

Function test(byval strLocation as string) as string
    Dim driver As SeleniumWrapper.WebDriver
    Set driver = New SeleniumWrapper.WebDriver
    driver.Start "chrome", "https://re.po.st"
    driver.Open strLocation
    Dim data1
    data1 = driver.FindElementById("sguidtotaltable").FindElementByTagName("span").Text
    test = data1
    driver.stop 'Stops the browser
End Function

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM