뷰티플 수프

Jmnote (토론 | 기여)님의 2019년 12월 11일 (수) 23:19 판 (→‎참고)

1 개요

Beautiful Soup
뷰티풀 수프
  • HTML과 XML 파일의 데이터를 가져오기 위한 파이썬 라이브러리

 

from bs4 import BeautifulSoup
from urllib.request import urlopen

with urlopen('https://en.wikipedia.org/wiki/Main_Page') as response:
    soup = BeautifulSoup(response, 'html.parser')
    for anchor in soup.find_all('a'):
        print(anchor.get('href', '/'))

2 같이 보기

3 참고