"뷰티플 수프"의 두 판 사이의 차이

잔글 (봇: 자동으로 텍스트 교체 (-==참고 자료== +==참고==))
5번째 줄: 5번째 줄:


https://www.crummy.com/software/BeautifulSoup/bs4/doc/_images/6.1.jpg
https://www.crummy.com/software/BeautifulSoup/bs4/doc/_images/6.1.jpg
<source lang='python'>
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', '/'))
</ssource>


==같이 보기==
==같이 보기==
11번째 줄: 21번째 줄:


==참고==
==참고==
* {{영어위키백과|Beautiful Soup (HTML parser)}}
* https://www.crummy.com/software/BeautifulSoup/bs4/doc/
* https://www.crummy.com/software/BeautifulSoup/bs4/doc/


[[분류: Python 라이브러리]]
[[분류: Python 라이브러리]]
[[분류: HTML 파서]]
[[분류: XML 파서]]
[[분류: MIT 라이선스]]

2019년 12월 11일 (수) 23:18 판

1 개요

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

 

<source lang='python'> 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', '/'))

</ssource>

2 같이 보기

3 참고

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}