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
538 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 ...
Advice on how to scrape tables of data or HTML from webpages using VBA Part one of a three-part series of blogs |
---|
You can use VBA to extract data from web pages, either as whole tables or by parsing the underlying HTML elements. This blog shows you how to code both methods (the technique is often called "web-scraping").
|
In this blog
There are two ways to get information from websites programmatically: by downloading their data, or by parsing their HTML.
If yoiur VBA skills aren't up to scratch, we've got lots of VBA training material on this website to help you!
If you want to get at tables of data published to a website (such as currency exchange rates, fantasy football tables or weather forecast data), the easiest way to do it is by adding a linked table into Excel:
An example - importing a list of all forthcoming advanced Excel courses from the Wise Owl site.
While the data for this example is years out of date, all the principles (and the VBA) are still valid.
This is a bit harder, since you need to understand a bit about HTML, and be prepared to work hard to parse data in VBA. The example we'll cover will download a list of all of the questions from the StackOverflow home page:
What the downloaded data will look like after running our macro.
The rest of this blog shows how to do each of these tasks, beginning with the simpler one: querying a table of data on a website.
Parts of this blog |
---|
|
Some other pages relevant to the above blogs include:
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.