강좌
클라우드/리눅스에 관한 강좌입니다.
프로그램 분류

파이썬기초110 : 네이버웹툰 웹크롤링

작성자 정보

  • 관리자 작성
  • 작성일

컨텐츠 정보

본문

주소

>>> data = urllib.urlopen('http://comic.naver.com/webtoon/list.nhn?titleId=20853&weekday=fri')


전체 코드 

>>> import urllib.request

>>> from bs4 import BeautifulSoup

>>> data = urllib.request.urlopen('http://comic.naver.com/webtoon/list.nhn?titleId=20853&weekday=fri')

>>> soup = BeautifulSoup(data, 'html5lib')

>>> soup

>>> title = cartoons[0].find('a').text

>>> link = cartoons[0].find('a')['href']

>>> print(title)

>>> print(link)

>>> for item in cartoons:

title = item.find('a').text

print(title)

관련자료

댓글 0
등록된 댓글이 없습니다.

공지사항


뉴스광장


  • 현재 회원수 :  60,034 명
  • 현재 강좌수 :  35,789 개
  • 현재 접속자 :  261 명