predictive-punter / punters_client

Python client library for www.punters.com.au
MIT License
6 stars 3 forks source link

TypeError: expected string or bytes-like object when using scrape_races #52

Open mgpullen opened 5 years ago

mgpullen commented 5 years ago

I stepped through the 'Basic Usage' of punters_client (literally copy-paste) and everything worked up until using scrape_races. When running races = scraper.scrape_races(meet) the following error was received: "TypeError: expected string or bytes-like object". image

See the attached image where the error can be traced back to line182 in re.py (return _compile(pattern, flags).search(string)).

I'm using Docker Toolbox on Windows 10 to run a datascience-notebook docker container. I'm running your code in a Jupyter Lab on that container that has Python 3.6 installed. The following packages are all installed and seem to be working: cache_requests, lxml

Any help would be great!

Shantanu-repo commented 4 years ago

It's because the variable URL is empty when passed to the re.search function.