Created
April 13, 2015 14:20
-
-
Save Baekjoon/fc1a19ec1121283a0813 to your computer and use it in GitHub Desktop.
rank-to-json-get-trs
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 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