Garlo

New Member
Joined
Sep 28, 2021
Messages
3
Platform
  1. Windows
Hi,

I would love for some help in writing some VBA code such that it will scrape data from a given URL for betting sites, and will return the specific betting odd values as required within a sheet. I then want it so that these values can always be refreshed as required.

For example:

Using Sportsbet as the website in question,

URL - https://www.sportsbet.com.au/

I would like to take all of the games within the featured section for soccer and place the respective betting odd values for each game (home, draw and away) in a table in excel for each of the games.

Soccer URL - https://www.sportsbet.com.au/betting/soccer

See the following attached image of the spreadsheet for what I would like the final product to look like once the macro VBA code has been run.

Thank you for any help!
 

Attachments

  • Example of final sheet product.JPG
    Example of final sheet product.JPG
    57.6 KB · Views: 159
  • Example of sportsbet page to pull data from.JPG
    Example of sportsbet page to pull data from.JPG
    99.9 KB · Views: 176

Excel Facts

Which came first: VisiCalc or Lotus 1-2-3?
Dan Bricklin and Bob Frankston debuted VisiCalc in 1979 as a Visible Calculator. Lotus 1-2-3 debuted in the early 1980's, from Mitch Kapor.
Sure - happy to help. What do you have so far?
 
Upvote 0
Sure - happy to help. What do you have so far?
Hi mate, awesome!
Unfortunately I don't really have anything so far, and am pretty stumped as to where to start (im just starting to learn vba). I can open a website using vba, but that's all I know how to do. Do you have any code that would do it?
Cheers
 
Upvote 0
I think this could be a tricky one - because: (1) the website is geographically limited; and (2) unsurprisingly, it makes liberal use of Javascript - clearly with a view to stop users from scraping its data. I tried to check the website to see what it would require, but people outside of Australia cannot access it - this will make it difficult for you to get people to help you out, because if we can't see the code...well... Anyway, I managed to access the site (through a VPN), and looked at the code - it would be quite tricky. If you plan on using Excel. I expect you will need to use VBA and a third party piece of software called Selenium. It's free, but that would be your only option.

Alternatively, you might be able to use Power Automate Desktop. It's another piece of Microsoft software that was released for free last year, and it is designed to help users automate parts of their lives. From memory it has some webscraping functionality, and can produce the results as an Excel spreadsheet. There are free Chrome extensions that do webscraping too that you may want to check out. No matter what route you end up going down, it will need to involve either Chrome, Edge or Firefox given the use of Javascript.

That's the only other options that come to mind. Other than that, I think it will have to be a good-ol-fashioned-learn-to-code situation....? :-)
 
Upvote 0
I think this could be a tricky one - because: (1) the website is geographically limited; and (2) unsurprisingly, it makes liberal use of Javascript - clearly with a view to stop users from scraping its data. I tried to check the website to see what it would require, but people outside of Australia cannot access it - this will make it difficult for you to get people to help you out, because if we can't see the code...well... Anyway, I managed to access the site (through a VPN), and looked at the code - it would be quite tricky. If you plan on using Excel. I expect you will need to use VBA and a third party piece of software called Selenium. It's free, but that would be your only option.

Alternatively, you might be able to use Power Automate Desktop. It's another piece of Microsoft software that was released for free last year, and it is designed to help users automate parts of their lives. From memory it has some webscraping functionality, and can produce the results as an Excel spreadsheet. There are free Chrome extensions that do webscraping too that you may want to check out. No matter what route you end up going down, it will need to involve either Chrome, Edge or Firefox given the use of Javascript.

That's the only other options that come to mind. Other than that, I think it will have to be a good-ol-fashioned-learn-to-code situation....? :)
ahh yes righto, sounds tricky, thanks for the effort you're putting in though, really appreciate it!
If there is another website that you can access more easily (Bet365, ladbrokes, pointsbet, williamhill etc), and you have code for those instead I would be very happy because I can also use those websites and just want a real, working example that I can use and learn off so that I can make more code for other websites in the future. Do you have any code for any other websites, or at least know how to write it?
Thanks mate!
 
Upvote 0
Hi - I'm sorry, I completely missed this response of yours. I'm afraid I don't have any code for any gambling websites - assuming that they don't have any tricky anti-scraping technology in use, I can't imagine it would be that difficult to do though.

Depending on exactly what kind of data you're after, you may also want to consider looking into APIs. Websites sometimes offer to provide their data for free (or sometimes on a paid subscription basis) through an API - they do this because webscraping can cause them headaches, and it's just easier to provide the info via an API.

Again, if you're not experienced with coding, I really would recommend a no-code solution, of which there are many free options.
 
Upvote 0

Forum statistics

Threads
1,224,814
Messages
6,181,120
Members
453,021
Latest member
Justyna P

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