【问题标题】:I Don't want to wait for whole page to be loaded while automating browser using selenium and Excel VBA我不想在使用 selenium 和 Excel VBA 自动浏览器时等待整个页面加载
【发布时间】:2021-05-06 19:39:45
【问题描述】:

我正在尝试使用 Excel VBA 和 Selenium 自动化 Google Chrome

但我用于访问数据的网站在完全加载之前会加载大量广告! Data Website Link

触发下一个命令所需的元素甚至在整页加载 1 秒之前就已经存在。 但是代码在触发下一个命令之前等待页面完全加载。(整个页面加载几乎需要 7-8 秒)。

红框中的元素是我真正需要的。但是代码会等待加载所有内容,例如广告和任何不需要的脚本

如何更改等待时间,使其不等待加载完整内容。

【问题讨论】:

    标签: excel vba selenium selenium-webdriver vba7


    【解决方案1】:

    您不能只测试该项目的存在吗?仅将 Selenium 与 C# 一起使用,但想一些类似的东西。

    Do 
        set el = driver.getelementbyid("idfoo")
        'few milisecond wait here not bad idea
    Loop Until not El is nothing
    

    【讨论】:

      猜你喜欢
      • 2017-04-17
      • 2014-09-26
      • 2013-05-19
      • 2018-03-20
      • 1970-01-01
      • 2016-08-26
      • 2011-10-13
      • 1970-01-01
      • 2018-03-01
      相关资源
      最近更新 更多