Created
April 6, 2019 19:26
-
-
Save jbarton311/47dd7fbf37c3714dd0c22b8c711fe9ee to your computer and use it in GitHub Desktop.
pull golf world rankings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
# Started by Googling "World Golf Rankings" | |
# Clicked on 1st site I found | |
# Needed to expand the ranking table to "all" | |
data = pd.read_html('http://www.owgr.com/ranking?pageNo=1&pageSize=All&country=All') | |
# pd.read_html will return a list of data frames | |
# usually you need to go through this list to find the data | |
# you are looking for | |
rankings_df = data[0] | |
# This dataframe will need a little clean up but the data is there |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment