안경잡이개발자

728x90
반응형

  소스코드는 다음과 같습니다.


import urllib.request
from bs4 import BeautifulSoup


def main():

    url = "https://pann.nate.com/talk/344403021"
    soup = BeautifulSoup(urllib.request.urlopen(url).read(), "html.parser")

    comments = []

    for i in soup.find_all("dd", class_="usertxt"):
        comments.append(i.get_text().strip("\n\t "))

    print(comments)


if __name__ == "__main__":
    main()


728x90
반응형

Comment +0