Create a CSV of Strictly Come Dancing (UK) scores from the data in the show's Wikipedia pages.
The output from the current code is stored in output.csv
.
Code to create a CSV file containing scores for Strictly Come Dancing (UK) from Wikipedia
License: MIT License
May the names of celebrity and professional dancers to full names. Note that most entries are currently just the first name, but some entries hint at the surname (e.g. Emma B.
).
Series 7, 8, 9, and 10 are missing their initial week or two, where the dances are broken up into multiple tables.
The number of judges has varied from 3 to 5. Hence, the absolute score does not reflect fairly the quality of each dance. Detect the number of judges and create a new column for average score.
Some table cells for couples include a footnote marker (e.g. <td>Anastacia & Gorka<sup>1</sup>\n</td>
. This results in 14,5,Anastacia,Gorka,,1
- no dance and a score of 1.
Using lol_html
this gives three text nodes, each of which has last_in_text_node()
returning true
. This causes the td
selector to update the state before the end of the <td>
element. It is possible to suppress the inner tag text (see cloudflare/lol-html#93) but there are still the two nodes Anastacia & Gorka
and \n
.
nth-of-type
selector, remembering to deal with rowspans (e.g. 1st child is usually couple, but may be score).8,4,Michelle Williams,Ian*,Tango,27,4,6.75,
9,7,Holly Valance,Brendan*,Rumba,34,4,8.5,
9,9,Anita Dobson,Brendan*,Cha-Cha-Cha,30,4,7.5,
The asterisk in the couple name gets through to the CSV data.
Series 7 week 11 has a group dance with all the results in one row, separated by linebreaks:
<tr>
<td>Ali & Brian<br />Chris & Ola<br />Laila & Anton<br />Natalie & Vincent<br />Ricky & Natalie
</td>
<td>10<br />7<br />8<br />7<br />9
</td>
<td>Viennese Waltz
</td>
Currently this is ignored, but we could handle this.
The serde serialization adds a header row before the rows of each series.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.