【问题标题】:VBA Selenium vs. HTMLVBA 硒与 HTML
【发布时间】:2021-06-20 04:52:45
【问题描述】:

我正在使用 VBA 访问和下载文件,但我正在努力寻找元素。

我有这段代码可以在浏览器控制台中完美运行,但我对 selenium 不是很熟悉,所以我请你帮我“翻译”成 VBA

($(".yui3-c-reportdashboardwidget-reportLabel[title='nameoftable']").parent()).find("a.ember-view").click();

VBA 我需要

driver.FindElementByXpath().Click

driver.FindElementByCss().CLick

非常感谢 P.

【问题讨论】:

    标签: vba selenium-webdriver web-scraping


    【解决方案1】:

    我找到了解决方案,VBA 中存在“ExecuteScript”命令。 所以解决方案是:

    driver.ExecuteScript ("$("".yui3-c-reportdashboardwidget-reportLabel[title='mytablename']"").parent().find('a.ember-view').click();")
    

    【讨论】:

      猜你喜欢
      • 2021-10-10
      • 2020-07-01
      • 1970-01-01
      • 1970-01-01
      • 2011-05-05
      • 2014-12-26
      • 1970-01-01
      • 2021-04-27
      • 1970-01-01
      相关资源
      最近更新 更多