반응형 Python1 [파이썬 Python] 웹크롤링 : BeautifulSoup 간단히 살펴보기 (with Code) 1.2.2. import urllib from bs4 import BeautifulSoup from urllib.request import urlopen html = urlopen("http://pythonscraping.com/pages/page1.html") bs0bj = BeautifulSoup(html.read(), "html.parser") print(bs0bj.html.body.h1, bs0bj.h1) 1.2.3. from urllib.request import urlopen, HTTPError from bs4 import BeautifulSoup try: html = urlopen("http://www.pythonscraping.com/pages/error.html") except HTTPE.. 2017. 12. 31. 이전 1 다음 반응형