본문 바로가기
Python

BeautifulSoup 크롤링 기본코드

by 율✌️ 2022. 5. 19.
import requests
from bs4 import BeautifulSoup

url = 'http://www. 롤링할 웹페이지 URL 입력/com/movie~~~'

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(url,headers=headers)

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

# 여기부터 코딩시작