본문 바로가기
코딩공부

220120 [코딩공부] 넷플릭스크롤링 영화제목가져오기

by Just J.S. 2022. 1. 22.

from selenium import webdriver
from selenium.webdriver.chrome.service import Service
s = Service('c:/users/smile/desktop/chromedriver.exe')
driver = webdriver.Chrome(service=s)

url='https://www.netflix.com/ph/browse/genre/839338'
driver.get(url)
html=driver.page_source
from bs4 import BeautifulSoup
soup=BeautifulSoup(html,'html.parser')

section_list=soup.select('section')
section=section_list[2].text
print(section)

section_list=soup.select('section')
section=section_list[2]
section_title=section.select('h2')[0].text
print(section_title)

댓글