sw1203 / SportsInfo

2 stars 0 forks source link

데이터 수집을 위한 crawling 코드 작성 #6

Open sw1203 opened 2 months ago

sw1203 commented 2 months ago

@devdeankang 일단 간단히 백넘버, 이름, 국적, 포지션, 주발, 키, 몸값, 나이, 이전 팀 같은 것만 수집해봤어 아래처럼 될 것 같은데 검토 부탁

{
    "manchester-city": {
        "team_name": "Manchester City",
        "league": "Premier League",
        "player": [
            {
                "back_number": "31",
                "name": "Ederson",
                "position": "Goalkeeper",
                "birth": "Aug 17, 1993",
                "age": "31",
                "nation": "Brazil",
                "height": "1,88m",
                "foot": "left",
                "joined": "Jul 1, 2017",
                "signed_from": "SL Benfica",
                "contract_expires": "Jun 30, 2026",
                "market_value": "€35.00m"
            },
            {
                "back_number": "18",
                "name": "Stefan Ortega",
                "position": "Goalkeeper",
                "birth": "Nov 6, 1992",
                "age": "31",
                "nation": "Germany",
                "height": "1,85m",
                "foot": "right",
                "joined": "Jul 1, 2022",
                "signed_from": "Arminia Bielefeld",
                "contract_expires": "Jun 30, 2026",
                "market_value": "€9.00m"
            },
            {
                "back_number": "33",
                "name": "Scott Carson",
                "position": "Goalkeeper",
                "birth": "Sep 3, 1985",
                "age": "39",
                "nation": "England",
                "height": "1,88m",
                "foot": "right",
                "joined": "Jul 20, 2021",
                "signed_from": "Derby County",
                "contract_expires": "Jun 30, 2025",
                "market_value": "€200k"
            },
            {
                "back_number": "3",
                "name": "Rúben Dias",
                "position": "Centre-Back",
                "birth": "May 14, 1997",
                "age": "27",
                "nation": "Portugal",
                "height": "1,87m",
                "foot": "right",
                "joined": "Sep 29, 2020",
                "signed_from": "SL Benfica",
                "contract_expires": "Jun 30, 2027",
                "market_value": "€80.00m"
            },
            {
                "back_number": "25",
                "name": "Manuel Akanji",
                "position": "Centre-Back",
                "birth": "Jul 19, 1995",
                "age": "29",
                "nation": "Switzerland",
                "height": "1,88m",
                "foot": "right",
                "joined": "Sep 1, 2022",
                "signed_from": "Borussia Dortmund",
                "contract_expires": "Jun 30, 2027",
                "market_value": "€45.00m"
            },
            {
                "back_number": "6",
                "name": "Nathan Aké",
                "position": "Centre-Back",
                "birth": "Feb 18, 1995",
                "age": "29",
                "nation": "Netherlands",
                "height": "1,80m",
                "foot": "left",
                "joined": "Aug 5, 2020",
                "signed_from": "AFC Bournemouth",
                "contract_expires": "Jun 30, 2027",
                "market_value": "€40.00m"
            },
            {
                "back_number": "5",
                "name": "John Stones",
                "position": "Centre-Back",
                "birth": "May 28, 1994",
                "age": "30",
                "nation": "England",
                "height": "1,88m",
                "foot": "right",
                "joined": "Aug 9, 2016",
                "signed_from": "Everton FC",
                "contract_expires": "Jun 30, 2026",
                "market_value": "€38.00m"
            },
            {
                "back_number": "24",
                "name": "Josko Gvardiol",
                "position": "Left-Back",
                "birth": "Jan 23, 2002",
                "age": "22",
                "nation": "Croatia",
                "height": "1,85m",
                "foot": "left",
                "joined": "Aug 5, 2023",
                "signed_from": "RB Leipzig",
                "contract_expires": "Jun 30, 2028",
                "market_value": "€75.00m"
            },
            {
                "back_number": "97",
                "name": "Josh Wilson-Esbrand",
                "position": "Left-Back",
                "birth": "Dec 26, 2002",
                "age": "21",
                "nation": "England",
                "height": "1,76m",
                "foot": "left",
                "joined": "Jan 1, 2023",
                "signed_from": "Manchester City U21",
                "contract_expires": "Jun 30, 2027",
                "market_value": "€4.00m"
            },
            {
                "back_number": "82",
                "name": "Rico Lewis",
                "position": "Right-Back",
                "birth": "Nov 21, 2004",
                "age": "19",
                "nation": "England",
                "height": "1,69m",
                "foot": "right",
                "joined": "Jul 1, 2022",
                "signed_from": "Manchester City U18",
                "contract_expires": "Jun 30, 2028",
                "market_value": "€38.00m"
            },
            {
                "back_number": "2",
                "name": "Kyle Walker",
                "position": "Right-Back",
                "birth": "May 28, 1990",
                "age": "34",
                "nation": "England",
                "height": "1,78m",
                "foot": "right",
                "joined": "Jul 14, 2017",
                "signed_from": "Tottenham Hotspur",
                "contract_expires": "Jun 30, 2026",
                "market_value": "€13.00m"
            },
            {
                "back_number": "16",
                "name": "Rodri",
                "position": "Defensive Midfield",
                "birth": "Jun 22, 1996",
                "age": "28",
                "nation": "Spain",
                "height": "1,91m",
                "foot": "right",
                "joined": "Jul 4, 2019",
                "signed_from": "Atlético de Madrid",
                "contract_expires": "Jun 30, 2027",
                "market_value": "€130.00m"
            },
            {
                "back_number": "27",
                "name": "Matheus Nunes",
                "position": "Central Midfield",
                "birth": "Aug 27, 1998",
                "age": "26",
                "nation": "Portugal",
                "height": "1,83m",
                "foot": "right",
                "joined": "Sep 1, 2023",
                "signed_from": "Wolverhampton Wanderers",
                "contract_expires": "Jun 30, 2028",
                "market_value": "€50.00m"
            },
            {
                "back_number": "8",
                "name": "Mateo Kovacic",
                "position": "Central Midfield",
                "birth": "May 6, 1994",
                "age": "30",
                "nation": "Croatia",
                "height": "1,77m",
                "foot": "right",
                "joined": "Jul 1, 2023",
                "signed_from": "Chelsea FC",
                "contract_expires": "Jun 30, 2027",
                "market_value": "€30.00m"
            },
            {
                "back_number": "19",
                "name": "",
                "position": "Central Midfield",
                "birth": "Oct 24, 1990",
                "age": "33",
                "nation": "Germany",
                "height": "1,80m",
                "foot": "right",
                "joined": "Aug 23, 2024",
                "signed_from": "FC Barcelona",
                "contract_expires": "Jun 30, 2025",
                "market_value": "€15.00m"
            },
            {
                "back_number": "87",
                "name": "James McAtee",
                "position": "Central Midfield",
                "birth": "Oct 18, 2002",
                "age": "21",
                "nation": "England",
                "height": "1,80m",
                "foot": "left",
                "joined": "Jul 1, 2023",
                "signed_from": "Manchester City U21",
                "contract_expires": "Jun 30, 2026",
                "market_value": "€12.00m"
            },
            {
                "back_number": "20",
                "name": "Bernardo Silva",
                "position": "Attacking Midfield",
                "birth": "Aug 10, 1994",
                "age": "30",
                "nation": "Portugal",
                "height": "1,73m",
                "foot": "left",
                "joined": "Jul 1, 2017",
                "signed_from": "AS Monaco",
                "contract_expires": "Jun 30, 2026",
                "market_value": "€70.00m"
            },
            {
                "back_number": "17",
                "name": "Kevin De Bruyne",
                "position": "Attacking Midfield",
                "birth": "Jun 28, 1991",
                "age": "33",
                "nation": "Belgium",
                "height": "1,81m",
                "foot": "right",
                "joined": "Aug 30, 2015",
                "signed_from": "VfL Wolfsburg",
                "contract_expires": "Jun 30, 2025",
                "market_value": "€50.00m"
            },
            {
                "back_number": "11",
                "name": "Jérémy Doku",
                "position": "Left Winger",
                "birth": "May 27, 2002",
                "age": "22",
                "nation": "Belgium",
                "height": "1,73m",
                "foot": "right",
                "joined": "Aug 24, 2023",
                "signed_from": "Stade Rennais FC",
                "contract_expires": "Jun 30, 2028",
                "market_value": "€65.00m"
            },
            {
                "back_number": "10",
                "name": "Jack Grealish",
                "position": "Left Winger",
                "birth": "Sep 10, 1995",
                "age": "28",
                "nation": "England",
                "height": "1,80m",
                "foot": "right",
                "joined": "Aug 5, 2021",
                "signed_from": "Aston Villa",
                "contract_expires": "Jun 30, 2027",
                "market_value": "€60.00m"
            },
            {
                "back_number": "47",
                "name": "Phil Foden",
                "position": "Right Winger",
                "birth": "May 28, 2000",
                "age": "24",
                "nation": "England",
                "height": "1,71m",
                "foot": "left",
                "joined": "Jul 1, 2017",
                "signed_from": "Manchester City U18",
                "contract_expires": "Jun 30, 2027",
                "market_value": "€150.00m"
            },
            {
                "back_number": "26",
                "name": "",
                "position": "Right Winger",
                "birth": "Apr 10, 2004",
                "age": "20",
                "nation": "Brazil",
                "height": "1,76m",
                "foot": "left",
                "joined": "Jul 18, 2024",
                "signed_from": "ESTAC Troyes",
                "contract_expires": "Jun 30, 2029",
                "market_value": "€50.00m"
            },
            {
                "back_number": "52",
                "name": "Oscar Bobb",
                "position": "Right Winger",
                "birth": "Jul 12, 2003",
                "age": "21",
                "nation": "Norway",
                "height": "1,75m",
                "foot": "left",
                "joined": "Jul 1, 2023",
                "signed_from": "Manchester City U21",
                "contract_expires": "Jun 30, 2029",
                "market_value": "€25.00m"
            },
            {
                "back_number": "9",
                "name": "Erling Haaland",
                "position": "Centre-Forward",
                "birth": "Jul 21, 2000",
                "age": "24",
                "nation": "Norway",
                "height": "1,95m",
                "foot": "left",
                "joined": "Jul 1, 2022",
                "signed_from": "Borussia Dortmund",
                "contract_expires": "Jun 30, 2027",
                "market_value": "€180.00m"
            }
        ]
    }
}
devdeankang commented 2 months ago

"back_number": "26", "name": "", "position": "Right Winger", "birth": "Apr 10, 2004", "age": "20", "nation": "Brazil", "height": "1,76m", "foot": "left", "joined": "Jul 18, 2024", "signed_from": "ESTAC Troyes", "contract_expires": "Jun 30, 2029", "market_value": "€50.00m"

  1. "name" 에 대한 Value값이 안들어와서 확인 한 번 필요할 듯 ?
  2. age는 따로 안가져오고 그냥 birth만 가져와서 birth 앞자리로 연산시키는게 나을수도?... 누적데이터하다보면 많아지니까! 어떻게 생각하시나요
sw1203 commented 2 months ago
  1. "name" value가 안들어온 이유는 이번에 이적한 선수의 경우는 태그 구조가 다름 관련해서는 수정함 (19번: 귄도안 26번: 사비뉴)
  2. age는 제외하고 birth만 가져오겠음