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
 

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
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=-
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,194
Members
449,072
Latest member
DW Draft

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
Back
Top