Created
March 25, 2011 04:18
-
-
Save poochin/886355 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
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# scraping newer manga of club sunday. | |
import re | |
from urllib import urlopen | |
from BeautifulSoup import BeautifulSoup | |
url = 'http://club.shogakukan.co.jp/kod/new.html' | |
def main(): | |
rawhtml = urlopen(url).read() | |
soup = BeautifulSoup(rawhtml) | |
container = soup.find('div', id='mainWrapper') | |
rawlinks = re.findall("(?<=openViewer\(').+(?=&otk)", str(container)) | |
links = [link.replace('&', '&') for link in rawlinks] | |
print links | |
if __name__ == '__main__': | |
main() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment