Web Scraping Sofascore – Match Statistics

SofaScore is a popular live sports scores and statistics website which shows data for a wide range of sports in real time. In this article you will learn how to scrape match statistics from SofaScore website using WebHarvy.

WebHarvy lets you scrape match statistics from SofaScore website via an easy-to-use, point-and-click user interface. You can select the details which you need to scrape for each match by just clicking over the item text during the configuration process.

You will need to download and install WebHarvy on your computer. A free 15 days trial version of WebHarvy is available here. In addition to scraping data from SofaScore, WebHarvy also supports extracting data from other sports live score and betting websites like OddsPortal, FlashScore, WhoScored, BetExplorer, StatScore etc.

Scraping Team Lineup, Substitutions, Cards, Goals etc.

Team lineup, substitutions, yellow/red cards, goal details etc. can be scraped from the match details page at SofaScore website. The lineup details can be selected for extraction by direct mouse clicks (refer video displayed below). The Goal Keeper, Defence, Mid field and Forward layers of the lineup can be separately extracted.

Scraping SofaScore Team Lineup

Details like goals, red/yellow cards and substitutions can be selected from the left side pane (towards the left of the lineup graphics) by using Regular Expressions. By selecting the entire text of this pane and by applying Regular Expression on the HTML source behind the text, the desired details can be extracted.

The regular expressions for selecting card details, substitutions and goal details are given below.

Yellow card[\s\S]*?<span[^>]*>([^<]*)

Red card[\s\S]*?<span[^>]*>([^<]*)

Substitution[\s\S]*?<span[^>]*>([^<]*)

>Goal[\s\S]*?<span[\s\S]*?<span[^>]*>([^<]*)

>Own goal[\s\S]*?<span[\s\S]*?<span[^>]*>([^<]*)

For the detailed steps, please refer to the following video.

Scraping Match Scores and Odds

The following video shows how WebHarvy can be configured to scrape match scores and odds (Home/Draw/Away odds) for all matches in a league (LaLiga).

Try WebHarvy

In case you are interested in using WebHarvy to scrape match data including live scores and odds from SofaScore website, we recommend that you refer to our getting started guide.

Have questions?

In case you have any questions or need assistance in configuring WebHarvy please contact our support team.

Related

  1. Scraping Live Scores from StatScore.com
  2. Web Scraping Football Statistics from FootyStats.org
  3. Scraping WhoScored.com Live Scores
  4. How to scrape football live scores?