안경잡이개발자

728x90
반응형

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


import urllib.request
from bs4 import BeautifulSoup

def main():
    soup = BeautifulSoup(urllib.request.urlopen("https://www.clien.net/service/group/community").read(), "html.parser")

    list_title = []
    list_nickname = []

    for i in soup.find_all("span", class_="subject_fixed"):
        list_title.append(i.get_text())

    for i in soup.find_all("span", class_="nickname"):
        list_nickname.append(i.get_text())

    print(list_title)
    print(list_nickname)

if __name__ == "__main__":
    main()


728x90
반응형

Comment +0