Skip to content

This updates the scraper to work with the current version of baseball-reference.com#1

Open
zfurman56 wants to merge 8 commits into
andrewblim:masterfrom
zfurman56:master
Open

This updates the scraper to work with the current version of baseball-reference.com#1
zfurman56 wants to merge 8 commits into
andrewblim:masterfrom
zfurman56:master

Conversation

@zfurman56
Copy link
Copy Markdown

There was previously an issue where the scraper would drop the first row of the table body because it's now a <th>, rather than a <tb>, causing the outputted dictionary keys to be mismatched with incorrect values. For instance, just try the example in the README, and it'll give you an ERA of 30, rather than the actual ERA of 2.89. This fixes that problem by including the <th> tag in the row searching process.

It also switches away from the deprecated function has_key, and instead uses has_attr.

zfurman56 and others added 8 commits April 2, 2017 16:16
Updated brscraper.py Depricated urllib2 library
Co-authored-by: Zach Furman <zach.furman1@gmail.com>
Co-authored-by: Zach Furman <zach.furman1@gmail.com>
Co-authored-by: Zach Furman <zach.furman1@gmail.com>
Use urllib instead of deprecated urllib2 library
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.

2 participants