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

new xpath queries and login support #9

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

louisthaboogie
Copy link

added new xpath queries and added a session cookie for login to see all bookmakers

@jhulka
Copy link

jhulka commented Apr 6, 2023

Still somer errors, Any help?

Data will be saved in the following directory: D:\Projects\scrapeOP
We start to collect season 2020-2021
We start to scrape the page n°1

DevTools listening on ws://127.0.0.1:52375/devtools/browser/0a773f49-71a0-49cf-8e07-f7727c9a49b5
Traceback (most recent call last):
  File "d:\Projects\scrapeOP\scrapeOP\FinalScraper.py", line 13, in <module>
    scrape_oddsportal_historical(sport = 'soccer', country = 'france', league = 'ligue-1', start_season = '2020-2021', nseasons = 1, current_season = 'no', max_page = 1)
  File "d:\Projects\scrapeOP\scrapeOP\functions.py", line 1615, in scrape_oddsportal_historical
    df = scrape_league_typeC(Season=start_season, sport=sport, country1=country,
  File "d:\Projects\scrapeOP\scrapeOP\functions.py", line 1106, in scrape_league_typeC
    scrape_current_tournament_typeC(
  File "d:\Projects\scrapeOP\scrapeOP\functions.py", line 989, in scrape_current_tournament_typeC
    data = scrape_page_typeC(page, sport, country, tournament, SEASON)
  File "d:\Projects\scrapeOP\scrapeOP\functions.py", line 946, in scrape_page_typeC
    content = get_data_typeC(i, link)
  File "d:\Projects\scrapeOP\scrapeOP\functions.py", line 815, in get_data_typeC
    reject_ads()
  File "d:\Projects\scrapeOP\scrapeOP\functions.py", line 1716, in reject_ads
    driver.find_element("xpath", '//*[@id="app"]/div/header/div[2]/div[1]/div/button').click()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webelement.py", line 94, in click
    self._execute(Command.CLICK_ELEMENT)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webelement.py", line 404, in _execute        
    return self._parent.execute(command, params)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 440, in execute
    self.error_handler.check_response(response)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 245, in check_response    raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
  (Session info: chrome=111.0.5563.147)
Stacktrace:
Backtrace:
        (No symbol) [0x00F8DCE3]
        (No symbol) [0x00F239D1]
        (No symbol) [0x00E34C70]
        (No symbol) [0x00E610D6]
        (No symbol) [0x00E58D05]
        (No symbol) [0x00E7AECC]
        (No symbol) [0x00E58726]
        (No symbol) [0x00E7B224]
        (No symbol) [0x00E8D57C]
        (No symbol) [0x00E7ACC6]
        (No symbol) [0x00E56F68]
        (No symbol) [0x00E580CD]
        GetHandleVerifier [0x01203832+2506274]
        GetHandleVerifier [0x01239794+2727300]
        GetHandleVerifier [0x0123E36C+2746716]
        GetHandleVerifier [0x01036690+617600]
        (No symbol) [0x00F2C712]
        (No symbol) [0x00F31FF8]
        (No symbol) [0x00F320DB]
        (No symbol) [0x00F3C63B]
        BaseThreadInitThunk [0x762500F9+25]
        RtlGetAppContainerNamedObjectPath [0x77377BBE+286]
        RtlGetAppContainerNamedObjectPath [0x77377B8E+238]

@jhulka
Copy link

jhulka commented Apr 6, 2023

Set your session cookie at line 239 ( you can find it on Chrome > inspect > Application > Cookies > "oddsportalcom_session" )

is not on line 239 but on line 813 is that correct? @louisthaboogie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants