Our training courses

Other training resources

Our training venues

Why we are different

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

Head office

Kingsmoor House

Railway Street

GLOSSOP

SK13 2AA

London

Landmark Offices

99 Bishopsgate

LONDON

EC2M 3XD

Manchester

Holiday Inn

25 Aytoun Street

MANCHESTER

M1 3AE

© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.

End of small page here
Please be aware that our website uses cookies!
I'm OK with this Tell me more ...