I'd like to scrape with python from this website: http://www.ssa.gov/oact/babynames/#ht=1
At the bottom, under the table of names, there are three tabs. I'm looking to POST to the form under the tab "Popular Names by Birth Year."
Here's my code:
from bs4 import BeautifulSoup import requests url = "http://www.ssa.gov/oact/babynames/" payload = { 'year': 2010, 'top': 50 } r = requests.post(url, data=payload) # returns status 200 soup = BeautifulSoup(r.text) print soup.prettify() This only returns the original page, not the generated page I'm looking for.
What could be the reason it's not returning the generated page?
THANKS!