Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import urllib as u
- from bs4 import BeautifulSoup as b
- import os as o
- class main():
- def __init__(self,url):
- self.url = url
- self.name = self.url.split('.')[1]
- source = u.urlopen(self.url).read()
- self.html = b(source,'html.parser').encode('utf-32')
- def soup(self):
- print self.html.prettify()
- main("http://www.wikipedia.org").soup()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement