Web Scrape BA/Excel

Discussion regarding the spreadsheet functionality of Bet Angel.
Post Reply
User avatar
MobiusGrey
Posts: 289
Joined: Fri Nov 23, 2018 8:10 pm

Just need a nudge in the right direction please. I’m looking at a little experiment, more as something to do rather than a serious attempt to make money.

I’m looking at using parsehub to web scrape a live in play stats football site. I’m then hoping to import this to excel and assign each stat a weighting. Based on the overall value of this and the in play time/score it will then place a back or lay bet in match odds but only if the odds are in a defined range.

I don’t know any VBA but willing to learn! Do I need VBA, I know basic Excel (Vlookup) that type of thing and dabbled with Python to an advanced beginner level. How difficult of an undertaking is this?
sniffer66
Posts: 1666
Joined: Thu May 02, 2019 8:37 am

If you can use Python and it was me I'd just use something like Beautiful Soup to do the scraping and data crunching, then pass directly to Guardian via an imported CSV. Cuts out the need for Excel and is simpler and less demanding on CPU/mem etc

I did a similar exercise using SofaScore, and once you crack the scraping it's pretty straightforward.

Having said all the above it's far simpler to go via a site API using JSON than it is to scrape the pages directly. Also prevents issues when web pages are updated and breaks your scrape. But that's all dependent on whether your preferred site has an API

I have an example script in the football automation sub forum that grabs the current score from SofaScore and passes to Guardian, if it helps. Easy enough to add in any of the available stats as well
User avatar
MobiusGrey
Posts: 289
Joined: Fri Nov 23, 2018 8:10 pm

sniffer66 wrote:
Wed Sep 08, 2021 10:34 pm
If you can use Python and it was me I'd just use something like Beautiful Soup to do the scraping and data crunching, then pass directly to Guardian via an imported CSV. Cuts out the need for Excel and is simpler and less demanding on CPU/mem etc

I did a similar exercise using SofaScore, and once you crack the scraping it's pretty straightforward.

Having said all the above it's far simpler to go via a site API using JSON than it is to scrape the pages directly. Also prevents issues when web pages are updated and breaks your scrape. But that's all dependent on whether your preferred site has an API

I have an example script in the football automation sub forum that grabs the current score from SofaScore and passes to Guardian, if it helps. Easy enough to add in any of the available stats as well
Magic! Thank you, I'll take a look at the script in the automation forum and see what I can do. SofaScore is fine, I was looking at using Flash Score but as I said it's just for my own learning so doesn't really matter which site I use to scrape the data.
sniffer66
Posts: 1666
Joined: Thu May 02, 2019 8:37 am

Good stuff. The autoit script I've posted will get you as far as the scores. It's a short step from there to grabbing the stats. You can even get the momentum graph data as well.

If you can get around in Python, autoit should be doable. It's BASIC based

But it's a useful start to grabbing the API data and working with the JSON.

Feel free to pm me if you need any help
Post Reply

Return to “Bet Angel - Spreadsheet / Excel chat”