joenano / rpscrape

Scrape horse racing results data and racecards.
140 stars 57 forks source link

AttributeError: 'NoneType' object has no attribute 'xpath' #93

Closed gerryg1980 closed 2 years ago

gerryg1980 commented 2 years ago

Hi,

Im getting the error below, when i try to scrape todays (26/12) race card's.

I have cloned the repository locally

"!python racecards.py today"

Is giving the following error

Traceback (most recent call last): File "racecards.py", line 430, in main() File "racecards.py", line 420, in main races = parse_races(session, race_docs, date) File "racecards.py", line 313, in parse_races runners = get_runners(profile_urls, race['race_id']) File "racecards.py", line 115, in get_runners json_str = doc[1].xpath('//body/script')[0].text.split('window.PRELOADED_STATE =')[1].split('})()')[0].strip().strip(';') AttributeError: 'NoneType' object has no attribute 'xpath'

joenano commented 2 years ago

this is a request limiting issue