Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Twelve players scraper HTML selectors #322

Merged
merged 9 commits into from
Jan 16, 2023
269 changes: 1 addition & 268 deletions db/players_twelve.json
Original file line number Diff line number Diff line change
@@ -1,268 +1 @@
[
{
"role": "JaviDefensa",
"firstName": "",
"lastName": "",
"image": "kunisports-17.webp",
"name": " ",
"id": "kunisports-17",
"team": {
"id": "kunisports",
"name": "Kunisports",
"image": "https://kingsleague.dev/teams/logos/kunisports.svg",
"imageWhite": "https://kingsleague.dev/teams/logos/kunisports-inverse.svg"
}
},
{
"role": "BorjaDelantero",
"firstName": "",
"lastName": "",
"image": "pio-fc-7.webp",
"name": " ",
"id": "pio-fc-7",
"team": {
"id": "pio-fc",
"name": "PIO FC",
"image": "https://kingsleague.dev/teams/logos/pio.svg",
"imageWhite": "https://kingsleague.dev/teams/logos/pio-inverse.svg"
}
},
{
"role": "SergioDelantero",
"firstName": "",
"lastName": "",
"image": "ultimate-mostoles-9.webp",
"name": " ",
"id": "ultimate-mostoles-9",
"team": {
"id": "ultimate-mostoles",
"name": "Ultimate Móstoles",
"image": "https://kingsleague.dev/teams/logos/ultimate-mostoles.svg",
"imageWhite": "https://kingsleague.dev/teams/logos/ultimate-mostoles-inverse.svg"
}
},
{
"role": "RubénMedio",
"firstName": "",
"lastName": "",
"image": "ultimate-mostoles-8.webp",
"name": " ",
"id": "ultimate-mostoles-8",
"team": {
"id": "ultimate-mostoles",
"name": "Ultimate Móstoles",
"image": "https://kingsleague.dev/teams/logos/ultimate-mostoles.svg",
"imageWhite": "https://kingsleague.dev/teams/logos/ultimate-mostoles-inverse.svg"
}
},
{
"role": "HugoDelantero",
"firstName": "",
"lastName": "",
"image": "porcinos-fc-11.webp",
"name": " ",
"id": "porcinos-fc-11",
"team": {
"id": "porcinos-fc",
"name": "Porcinos FC",
"image": "https://kingsleague.dev/teams/logos/porcinos-fc.svg",
"imageWhite": "https://kingsleague.dev/teams/logos/porcinos-fc-inverse.svg"
}
},
{
"role": "JordiDelantero",
"firstName": "",
"lastName": "",
"image": "aniquiladores-fc-18.webp",
"name": " ",
"id": "aniquiladores-fc-18",
"team": {
"id": "aniquiladores-fc",
"name": "Aniquiladores FC",
"image": "https://kingsleague.dev/teams/logos/aniquiladores.svg",
"imageWhite": "https://kingsleague.dev/teams/logos/aniquiladores-inverse.svg"
}
},
{
"role": "JoanMedio",
"firstName": "",
"lastName": "",
"image": "los-troncos-fc-23.webp",
"name": " ",
"id": "los-troncos-fc-23",
"team": {
"id": "los-troncos-fc",
"name": "Los Troncos FC",
"image": "https://kingsleague.dev/teams/logos/los-troncos.svg",
"imageWhite": "https://kingsleague.dev/teams/logos/los-troncos-inverse.svg"
}
},
{
"role": "AlbertoDelantero",
"firstName": "",
"lastName": "",
"image": "1k-23.webp",
"name": " ",
"id": "1k-23",
"team": {
"id": "1k",
"name": "1K FC",
"image": "https://kingsleague.dev/teams/logos/1k.svg",
"imageWhite": "https://kingsleague.dev/teams/logos/1k-inverse.svg"
}
},
{
"role": "JavierMedio",
"firstName": "",
"lastName": "",
"image": "kunisports-22.webp",
"name": " ",
"id": "kunisports-22",
"team": {
"id": "kunisports",
"name": "Kunisports",
"image": "https://kingsleague.dev/teams/logos/kunisports.svg",
"imageWhite": "https://kingsleague.dev/teams/logos/kunisports-inverse.svg"
}
},
{
"role": "JaviMedio",
"firstName": "",
"lastName": "",
"image": "pio-fc-5.webp",
"name": " ",
"id": "pio-fc-5",
"team": {
"id": "pio-fc",
"name": "PIO FC",
"image": "https://kingsleague.dev/teams/logos/pio.svg",
"imageWhite": "https://kingsleague.dev/teams/logos/pio-inverse.svg"
}
},
{
"role": "VíctorMedio",
"firstName": "",
"lastName": "",
"image": "los-troncos-fc-20.webp",
"name": " ",
"id": "los-troncos-fc-20",
"team": {
"id": "los-troncos-fc",
"name": "Los Troncos FC",
"image": "https://kingsleague.dev/teams/logos/los-troncos.svg",
"imageWhite": "https://kingsleague.dev/teams/logos/los-troncos-inverse.svg"
}
},
{
"role": "DavidDelantero",
"firstName": "",
"lastName": "",
"image": "aniquiladores-fc-7.webp",
"name": " ",
"id": "aniquiladores-fc-7",
"team": {
"id": "aniquiladores-fc",
"name": "Aniquiladores FC",
"image": "https://kingsleague.dev/teams/logos/aniquiladores.svg",
"imageWhite": "https://kingsleague.dev/teams/logos/aniquiladores-inverse.svg"
}
},
{
"role": "ChicharitoDelantero",
"firstName": "",
"lastName": "",
"image": "porcinos-fc-14.webp",
"name": " ",
"id": "porcinos-fc-14",
"team": {
"id": "porcinos-fc",
"name": "Porcinos FC",
"image": "https://kingsleague.dev/teams/logos/porcinos-fc.svg",
"imageWhite": "https://kingsleague.dev/teams/logos/porcinos-fc-inverse.svg"
}
},
{
"role": "IbaiDelantero",
"firstName": "",
"lastName": "",
"image": "jijantes-fc-11.webp",
"name": " ",
"id": "jijantes-fc-11",
"team": {
"id": "jijantes-fc",
"name": "Jijantes FC",
"image": "https://kingsleague.dev/teams/logos/jijantes.svg",
"imageWhite": "https://kingsleague.dev/teams/logos/jijantes-inverse.svg"
}
},
{
"role": "DídacDefensa",
"firstName": "",
"lastName": "",
"image": "rayo-barcelona-7.webp",
"name": " ",
"id": "rayo-barcelona-7",
"team": {
"id": "rayo-barcelona",
"name": "Rayo de Barcelona",
"image": "https://kingsleague.dev/teams/logos/rayo-barcelona.svg",
"imageWhite": "https://kingsleague.dev/teams/logos/rayo-barcelona-inverse.svg"
}
},
{
"role": "JorgeDelantero",
"firstName": "",
"lastName": "",
"image": "el-barrio-99.webp",
"name": " ",
"id": "el-barrio-99",
"team": {
"id": "el-barrio",
"name": "El Barrio",
"image": "https://kingsleague.dev/teams/logos/el-barrio.svg",
"imageWhite": "https://kingsleague.dev/teams/logos/el-barrio-inverse.svg"
}
},
{
"role": "JoanDefensa",
"firstName": "",
"lastName": "",
"image": "saiyans-fc-21.webp",
"name": " ",
"id": "saiyans-fc-21",
"team": {
"id": "saiyans-fc",
"name": "Saiyans FC",
"image": "https://kingsleague.dev/teams/logos/saiyans-fc.svg",
"imageWhite": "https://kingsleague.dev/teams/logos/saiyans-fc-inverse.svg"
}
},
{
"role": "EnigmaMedio",
"firstName": "",
"lastName": "",
"image": "xbuyer-team-69.webp",
"name": " ",
"id": "xbuyer-team-69",
"team": {
"id": "xbuyer-team",
"name": "XBUYER TEAM",
"image": "https://kingsleague.dev/teams/logos/xbuyer.svg",
"imageWhite": "https://kingsleague.dev/teams/logos/xbuyer-inverse.svg"
}
},
{
"role": "NandoMedio",
"firstName": "",
"lastName": "",
"image": "jijantes-fc-18.webp",
"name": " ",
"id": "jijantes-fc-18",
"team": {
"id": "jijantes-fc",
"name": "Jijantes FC",
"image": "https://kingsleague.dev/teams/logos/jijantes.svg",
"imageWhite": "https://kingsleague.dev/teams/logos/jijantes-inverse.svg"
}
}
]
[]
6 changes: 3 additions & 3 deletions scraping/players_twelve.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import { cleanText } from './utils.js'
const PLAYER_FOLDER_PATH = path.join(process.cwd(), './public/teams/players')

const PLAYER_SELECTORS = {
firstName: { selector: '.el-title', typeOf: 'string' },
lastName: { selector: '.el-meta', typeOf: 'string' },
firstName: { selector: '.fs-grid-meta-3', typeOf: 'string' },
lastName: { selector: '.fs-grid-text-3', typeOf: 'string' },
teamName: { selector: '.uk-text-lead', typeOf: 'string' },
role: { selector: '.fs-grid-meta', typeOf: 'string' }
role: { selector: '.fs-grid-meta-1', typeOf: 'string' }
}

let counter = 1000
Expand Down