WEB/python

[python] 크롤링 기본 뼈대

자바칩 프라푸치노 2021. 6. 10. 15:03
import requests
from bs4 import BeautifulSoup

headers = {'User-Agent' : 'Mozilla/5.0 (Windows NT 10.0; Win64; x64)AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.86 Safari/537.36'}
data = requests.get('https://movie.naver.com/movie/sdb/rank/rmovie.nhn?sel=pnt&date=20200303',headers=headers)

soup = BeautifulSoup(data.text, 'html.parser')

# 코딩 시작
# 크롤링이 가능한 이유는 뭐냐?
# 

bs4 interpreter을 깔아야함

728x90