import requests
from bs4 import BeautifulSoup
req = requests.get('URL')
html = req.text
soup = BeautifulSoup(html, "html.parser")
soup.prettify()
참조
[stackoverflow]: https://stackoverflow.com/questions/25729589/how-to-get-html-from-a-beautiful-soup-object
How to get HTML from a beautiful soup object
I have the following bs4 object listing: >>> listing <div class="listingHeader"> <h2> .... >>> type(listing) <class 'bs4.element.Tag'> I want to extract the raw
stackoverflow.com
728x90
'Programing Language > Python' 카테고리의 다른 글
[Python] 파이썬 공백제거 (0) | 2023.08.17 |
---|---|
[Python] print 함수 (0) | 2023.08.16 |
[Python] nonnumeric port (0) | 2023.05.30 |
[Python] Snake Case To Camel Case ( str, dict, list ) (0) | 2023.05.30 |
[Python] pydantic.error_wrappers.ValidationError (0) | 2023.05.21 |
댓글