Last active
August 29, 2015 14:08
-
-
Save Drunkar/30f8f7dd446f851b311d to your computer and use it in GitHub Desktop.
This file contains 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 BeautifulSoup import BeautifulStoneSoup | |
NUM = 1 | |
url = 'http://www.hogehoge.com?' | |
params = { | |
'param1':'para', | |
'param2': 'para' | |
} | |
results = [] | |
for i in range(0,NUM): | |
try: | |
req_url = url + urllib.urlencode(params) | |
res = urllib.urlopen(req_url) | |
soup = BeautifulStoneSoup(res.read()) | |
break | |
except: | |
continue | |
print soup.prettify() | |
links = soup.findAll('list_inf') | |
for link in links: | |
print link["id"] | |
print link |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment