If you follow live sport, you know the routine. You refresh a scores page every few minutes, trying to keep track of which matches are live, which have finished and which are still to come. The moment you want to record any of it — for a betting log, a fantasy tracker, a personal database or a message to a group chat — you are back to copying team names one at a time into a spreadsheet.
I wrote a free userscript that handles Sofascore data export for you. It adds a small panel to the pages you are already looking at and turns what is on screen into a CSV file or a PDF, in one click.
What the Sofascore data export script pulls off the page
The fields it reads
The script captures the information people following live sport actually use:
- Live scores, as they update in real time on the page
- Match schedules for the day or competition you are viewing
- Team names for every fixture on the page
- League or tournament each match belongs to
- Match status — live, finished, or not started yet
- Featured events, picked out separately on pages that highlight marquee fixtures
That last one matters more than it sounds. On a busy Saturday a scores page can hold two hundred fixtures. Being able to pull only the headline games means you are not filtering a spreadsheet afterwards to find the four matches you cared about.
What it cannot see
A userscript reads the page your browser has already drawn. That sets three honest limits, and I would rather you know them before installing than after:
- It captures what is rendered. If a section has not loaded or you have not scrolled it into view, it is not in the file.
- It has no memory. Each export is a snapshot of that moment. It does not build history across days.
- It only runs when you click. There is no schedule, no background job, no overnight collection.
For a lot of people that is fine — you want today's fixtures in a spreadsheet, and now you have them. If you need the same data collected every hour into a database, that is a different build, and I cover it further down.
Choosing between CSV and PDF
The CSV file and its columns
The CSV is for anyone who wants to do something with the data afterwards. The columns mirror the fields above: home team, away team, score, competition and status, one match per row. It is plain RFC 4180 comma-separated values, which is the format Excel, Google Sheets, Numbers and every other spreadsheet tool open without complaint.
Nothing needs cleaning first. You can sort by league, filter to finished matches, or paste the rows onto the bottom of a sheet you have been building all season.
If you find yourself pasting exports into the same sheet week after week, that is the point where a script should be writing to the destination directly — Google Sheets, Airtable, SQLite or PostgreSQL — instead of you acting as the middle step.
The PDF report
The PDF is for sharing and keeping. It produces a formatted document with selectable text, so it stays searchable and you can copy out of it later rather than squinting at a picture of a table.
It suits the cases where a spreadsheet is overkill: sending today's fixtures to a group chat, saving a record of how a tournament finished, or keeping a tidy archive you can search in six months.
Installing the Tampermonkey userscript
The five install steps
Tampermonkey is a browser extension that lets small custom scripts run on sites you visit. Nothing here needs a technical background.
- Install the Tampermonkey browser extension. It is available for Chrome, Firefox, Edge and most other major browsers.
- Open the Tampermonkey dashboard from the extension icon in your toolbar.
- Create a new userscript. You will get an empty editor window.
- Paste in the script code, replacing whatever template text is already there, and save.
- Go to Sofascore and open any match or live scores page.
Running your first export
Once the page loads, an export panel appears in the top-right corner. Pick a scope first:
- All matches currently visible — a full snapshot of the page
- Live only — games in progress, skipping finished and upcoming fixtures
- Featured only — the headline matches, nothing else
Then click CSV for a spreadsheet-ready file, or PDF for a shareable report. The file lands in your normal downloads folder.
When the export panel does not appear
Two things cause this, and they have different fixes.
The page has not finished rendering
Sofascore builds its score lists after the initial page load. If you install the script while sitting on a scores page, the script never ran on it. Refresh once and the panel appears. Same fix if you navigated between competitions without a full page reload.
Sofascore changed its markup
Every userscript identifies page elements by their structure. When a site ships a redesign, those identifiers stop matching and the script finds nothing.
What a broken selector looks like
Open your browser console and you will usually see something like Uncaught TypeError: Cannot read properties of null (reading 'textContent'). That means the script asked for an element using the MDN reference on querySelector, got back nothing, and tried to read a value off it anyway. It is a maintenance job, not a broken browser. Any userscript pointed at a site you do not control will need this occasionally.
Where the free script stops and a custom Sofascore scraper starts
The userscript covers one site, one page at a time, triggered by you. Plenty of jobs need more than that, and the line is usually one of these:
- Data collected on a schedule while you sleep, not when you remember to click
- More than one source combined into a single table
- Rows appended to a database — PostgreSQL, SQLite — instead of a fresh file each time
- Pages behind a login, or ones that need clicking and scrolling before the data appears
- A pipeline that pushes results into an existing REST or GraphQL API, or fires a webhook when something changes
That is what I build to order, usually in Python with Playwright driving a real browser. Every project runs through Fiverr. If you want to talk through a specific site, the DatafetchPro hire page</a> has the intake details, and <a href="/about">how I scope and price scraping work</a> explains what happens after you send a brief.
Terms of service and robots.txt
Before you install any userscript, read what it does. This one only reads the page you have open, but that is a habit worth keeping for every script you find online.
Beyond the code itself, check the site's terms of service and its robots.txt exclusion rules. Policies on automated collection vary between sites and change over time. I can tell you how a scraper works technically; whether you should run it against a particular site under its current terms is your call, not mine.
Common questions
Is the script free?
Yes. It is a userscript you paste into Tampermonkey. There is no account, no key and no paid tier.
Does it work on a phone?
Tampermonkey is a desktop browser extension, so this is a desktop workflow. Most mobile browsers do not support extensions at all.
Will it keep working?
Until Sofascore changes the parts of its page the script reads. When that happens the selectors need updating — see the troubleshooting section above.
Can you build the same thing for another site?
Usually. The approach transfers; the specifics never do, because every site structures its pages differently. Other scraping and automation walkthroughs on the blog show how the same pattern applies elsewhere.
