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'
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'