Pomoc przy kodzie AI

0

Witam,
Mam problem z kodem ze strony https://medium.com/@pierreia część kodu już poprawiłem ale nadal mam błędy i nie mogę ich obejść.
Jeśli jest jakiś magik który potrafił by pomóc to proszę o info.
Błędy:

Init...
Creating model...
Scraping prices...
Training model...
Model trained
Waiting for time <10s
Waiting for time <10s
Waiting for time <10s
Waiting for time <10s
Waiting for time <10s
Waiting for time <10s
Traceback (most recent call last):
  File "C:\Users\Sack\.spyder-py3\candle.py", line 259, in <module>
    bot.run()
  File "C:\Users\Sack\.spyder-py3\candle.py", line 227, in run
    self.scrape_next()
  File "C:\Users\Sack\.spyder-py3\candle.py", line 74, in scrape_next
    next_win_odd_str = self.driver.find_element(By.CSS_SELECTOR, "div.sc-fnebDD:nth:nth:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(1)").text
  File "D:\winpython\WPy64-3980\python-3.9.8.amd64\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 1244, in find_element
    return self.execute(Command.FIND_ELEMENT, {
  File "D:\winpython\WPy64-3980\python-3.9.8.amd64\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 424, in execute
    self.error_handler.check_response(response)
  File "D:\winpython\WPy64-3980\python-3.9.8.amd64\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 247, in check_response
    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.InvalidSelectorException: Message: Given css selector expression "div.sc-fnebDD:nth:nth:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(1)" is invalid: InvalidSelectorError: Document.querySelector: 'div.sc-fnebDD:nth:nth:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(1)' is not a valid selector: "div.sc-fnebDD:nth:nth:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(1) > div:nth-child(1) > div:nth-child(2) > div:nth-child(2) > div:nth-child(1) > div:nth-child(1)"
Stacktrace:
WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:181:5
InvalidSelectorError@chrome://remote/content/shared/webdriver/Errors.jsm:341:5
find_@chrome://remote/content/marionette/element.js:327:11
element.find/</findElements<@chrome://remote/content/marionette/element.js:281:24
evalFn@chrome://remote/content/marionette/sync.js:137:7
PollPromise/<@chrome://remote/content/marionette/sync.js:157:5
PollPromise@chrome://remote/content/marionette/sync.js:128:10
element.find/<@chrome://remote/content/marionette/element.js:279:24
element.find@chrome://remote/content/marionette/element.js:278:10
findElement@chrome://remote/content/marionette/actors/MarionetteCommandsChild.jsm:240:20
receiveMessage@chrome://remote/content/marionette/actors/MarionetteCommandsChild.jsm:99:31


C:\Users\Sack\.spyder-py3>
0

Jakiś problem z selektorami CSS. Swoją drogą po co w takiej aplikacji Selenium? edit: Aaa, dobra, bo to jakiś bot do scrapowania. On tam coś pisze Some html/CSS elements location would differ from when I coded the bot.
Plus nie wiem, czy prawidłowo jest, że ten selektor ma kilka razy nth po sobie: div.sc-fnebDD:nth:nth:nth-child(1)

0

Widzę że kolego coś kuma z tego kodu.
Problem z selektorami jest na tyle duży przy słabo opisanym kodzie że ciężko znaleźć z czym one korespondowały na stronie, część znalazłem i poprawiłem.
Kontakt z autorem praktycznie żaden.
Mam takie jeszcze pytanie co "robi" ten kod nth :nth:nth:nth-child(1) może naprowadzisz mnie jakoś jak będę wiedział co to robi?

1 użytkowników online, w tym zalogowanych: 0, gości: 1