Comments (4)
I got the same issue this morning when scraping 28/11/2020 gb results, but not when scraping 2/12/2020 gb results. Looking at the csv, the error seems to happen at approximately the 2.25 Newbury, which appears to have a database bug. If you check the result of that race, there are a number of horses which have '&' as their name so it seems to be an issue on RP's side annoyingly (but if there's a way round on our side that would be great).
from rpscrape.
Python's not my language, I'm only using this to scrape and export the csv to use in R, so this may not be the correct approach - however it seems to have worked.
On a branch, I've changed the fraction_to_decimal
function. It now has or fraction == '&' after the no odds statement.
def fraction_to_decimal(fractions):
decimal = []
for fraction in fractions:
if fraction == '' or fraction == 'No Odds' or fraction == '&':
decimal.append('')
elif 'evens' in fraction.lower() or fraction.lower() == 'evs':
decimal.append('2.00')
else:
decimal.append('{0:.2f}'.format(float(fraction.split('/')[0]) / float(fraction.split('/')[1]) + 1.00))
return decimal
from rpscrape.
Yep, I've just checked this on the aforementioned 28/11/20 data and it works a treat. I was expecting to have a bunch of horses with '&' as their name, but having checked the csv file that doesn't happen. It seems to just skip those horses where the errors have occurred. Thanks for uploading your changes.
from rpscrape.
Assuming this was a one off edge case and fixed.
from rpscrape.
Related Issues (20)
- ValueError: invalid literal for int() with base 10: '' HOT 2
- Sex Error HOT 4
- orjson.JSONDecodeError: trailing characters HOT 5
- Issues scraping data for the day HOT 3
- source code string cannot contain null bytes HOT 2
- TypeError: Dict key must be str HOT 5
- get_class_from_rating HOT 3
- ERROR: distance_to_furlongs() HOT 1
- IndexError: list index out of range - not scraping Wetherby 12/10 HOT 1
- Error pulling down today's racecards HOT 6
- Racecard Error on Tomorrow HOT 1
- Error extract results HOT 2
- TypeError: Dict key must be str HOT 2
- rpscrape not pulling GB jumps data between given dates HOT 3
- Issue getting data for a year HOT 1
- Problem downloading tomorrow's racecard (04-Nov-23) HOT 11
- Racecards Issue possibly HOT 1
- order by race time HOT 7
- rpscrape HOT 2
- Error in Jockey Data when Scraping HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from rpscrape.