Web scraping VBA

MrSharkX

New Member
Joined
Dec 26, 2020
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Hello

Currently, I'm working on a project where I will collect some soccer stats. Instead of doing it manually, there must be an easy way to collect this via VBA. However, I have been searching around the internet without luck and as I'm not the best one at VBA (hence only basic VBA knowledge), this seems to be difficult for me. However, I don't think this is complicated at all for people with VBA experience.

I am interested in scraping the data marked with yellow below, i.e. the data for the 19/20 season. Furthermore, I am interested in the possibility of changing this to another season or to another team, meaning that I would like to type in the saison_id and/or the team id into two cells in the excel spreadsheet, so that I can change it as wanted. This means that instead of just doing this for team name "Leicester" (id "1003" from link below) and saison_id = "2019", I could also be interested in doing the same for for instance team name "Everton" (id "29" in the link below) and "2019" or "2018" for instance, "Newcastle" and "2019" or "2018" for instance and so forth for other teams. In other words, in cell A1 for instance I will need to type in team id and in cell A2 for instance I will need to type in the saison id so that it will scrape the data.

Can someone please help me out? Thank you very much in advance!

1003/plus/0?saison_id=2019&wettbewerb_id=&day=&heim_gast=&punkte=&datum_von=-&datum_bis=-
29/plus/0?saison_id=2019&wettbewerb_id=&day=&heim_gast=&punkte=&datum_von=-&datum_bis=-

1609033243016.png
 

Some videos you may like

Excel Facts

Lock one reference in a formula
Need 1 part of a formula to always point to the same range? use $ signs: $V$2:$Z$99 will always point to V2:Z99, even after copying

MrSharkX

New Member
Joined
Dec 26, 2020
Messages
2
Office Version
  1. 2016
Platform
  1. Windows
Links above doesn't work.. I will type them in below, please remove the stars before copying the links:
*https://www.transfermarkt.*com/leicester-city/spielplandatum/verein/1003/plus/0?saison_id=2019&wettbewerb_id=&day=&heim_gast=&punkte=&datum_von=-&datum_bis=-
*https://www.transfermarkt.*com/everton-fc/spielplandatum/verein/29/plus/0?saison_id=2019&wettbewerb_id=&day=&heim_gast=&punkte=&datum_von=-&datum_bis=-
 

Watch MrExcel Video

Forum statistics

Threads
1,127,303
Messages
5,623,865
Members
415,997
Latest member
ragomes

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top