WiseOwl Training - Established 1992 Wise Owl Training

Established May 1992
30 years in business
Wise Owl Training
30 years in business
See 482 reviews for our classroom and online training

Details for EnginerdUNH

EnginerdUNH has participated in the following threads:

Added by EnginerdUNH on 07 Aug 2021 at 16:17

Hi Andrew,

I cannot begin to tell you how much your videos have helped me out in not only expanding my knowledge of VBA but also just making my excel macros more effective.  I have spent a few hours walking through your videos on Selenium step by step and now I'm trying to use the techniques that I've learned from these videos, particularly this one, to extract data from the following google page: us vaccine tracker - Google Search.  In looking at the HTML, the div tag that I am interested in grabbing has the following HTML code:

<div jsname="iXWWee" class="enWFYd KDN9Hf" style="left: 39px; display: block; transform: translate3d(381px, 0px, 0px);">May 26, 2021</div>

As you can see from the HTML, I should be able to get the element(s) by specifying the class name.  But upon further inspection, the area on the page I am interested in has an innerHTML value formatted like "MMM DD, YYYY" (shown in the above example as "May 26, 2021") which changes as you move your cursor across the page.  I tried to account for this one of two ways:

1) Dim Element as Selenium.WebElement

Set Element = ch.FindElementByCss("div[class='enWFYd KDN9Hf'] [innerHTML='May26,2021']")

Debug.Print Element.InnerHTML

2) Dim Elements As Selenium.WebElements

Set Elements = ch.FindElementsByCss("div[class='enWFYd KDN9Hf']")

For Each Element In Elements

Debug.Print Element.Attribute("innerHTML")
    Next Element