Skip to content

Instantly share code, notes, and snippets.

@Baekjoon
Created April 13, 2015 14:20
Show Gist options
  • Save Baekjoon/fc1a19ec1121283a0813 to your computer and use it in GitHub Desktop.
Save Baekjoon/fc1a19ec1121283a0813 to your computer and use it in GitHub Desktop.
rank-to-json-get-trs
import urllib
from bs4 import BeautifulSoup
fp = urllib.urlopen('https://www.acmicpc.net/ranklist')
source = fp.read()
fp.close()
soup = BeautifulSoup(source)
table = soup.find(id="ranklist")
trs = table.tbody.find_all('tr')
print trs
print len(trs)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment