Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
551 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
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
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2024. All Rights Reserved.