Skip to content
This repository was archived by the owner on Aug 23, 2024. It is now read-only.
This repository was archived by the owner on Aug 23, 2024. It is now read-only.

Error al lanzar script #1

@jesbrz

Description

@jesbrz

Hola Sergio. Estoy intentando utilizar el script de python para scrapear las estadísticas de la liga. Una vez configurado todo sin error, cuando lanzo el script, al cabo de un rato, me devuelve este error:

221121 18:43:19 [INFO ] Moving to https://www.laliga.com/en-ES/advanced-stats (core.py:43) 221121 18:43:55 [ERROR ] TimeoutException by Selenium (network.py:60) 221121 18:43:55 [WARNING ] No advertisements found (core.py:73) 221121 18:43:55 [INFO ] Getting season (core.py:76) Traceback (most recent call last) ────────────────────────────────╮ │ /laliga-data/main.py:27 in run │ │ │ │ 24 │ logger.setLevel(logzero.DEBUG if verbose else logzero.INFO) │ │ 25 │ │ │ 26 │ scraper = LaLigaScraper() │ │ ❱ 27 │ scraper.get_player_data(num_players) │ │ 28 │ scraper.to_dataframe() │ │ 29 │ scraper.wrangle_dataframe() │ │ 30 │ scraper.to_csv() │ │ │ │ ╭──────────────────────────── locals ─────────────────────────────╮ │ │ │ num_players = 0 │ │ │ │ scraper = <laliga.core.LaLigaScraper object at 0x117fad0d0> │ │ │ │ verbose = False │ │ │ ╰─────────────────────────────────────────────────────────────────╯ │ │ │ │ /laliga-data/laliga/core.py:152 in get_player_data │ │ │ │ 149 │ │ │ │ logger.error('Unable to retrieve data') │ │ 150 │ │ │ 151 │ def get_player_data(self, num_players=0): │ │ ❱ 152 │ │ while competition := self._load_next_competition(): │ │ 153 │ │ │ time.sleep(10) │ │ 154 │ │ │ self.get_player_data_by_competition(competition, num_players) │ │ 155 │ │ │ │ ╭──────────────────────────── locals ─────────────────────────────╮ │ │ │ num_players = 0 │ │ │ │ self = <laliga.core.LaLigaScraper object at 0x117fad0d0> │ │ │ ╰─────────────────────────────────────────────────────────────────╯ │ │ │ │ /laliga-data/laliga/core.py:119 in _load_next_competition │ │ │ │ 116 │ │ │ │ yield build_url(tr.td.a['href']) │ │ 117 │ │ │ 118 │ def _load_next_competition(self): │ │ ❱ 119 │ │ competitions_div = self.webdriver.find_element_by_xpath(self.competitions_div_xp │ │ 120 │ │ self.webdriver.execute_script('window.scrollTo(0, 0);') │ │ 121 │ │ time.sleep(1) │ │ 122 │ │ competitions_div.click() │ │ │ │ ╭───────────────────────── locals ─────────────────────────╮ │ │ │ self = <laliga.core.LaLigaScraper object at 0x117fad0d0> │ │ │ ╰──────────────────────────────────────────────────────────╯ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ AttributeError: 'WebDriver' object has no attribute 'find_element_by_xpath'

¿Sabes a qué puede ser debido?

un saludo y gracias.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions