from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from bs4 import BeautifulSoup
import requests 

headers ={
    "User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.164 Safari/537.36",
    "Accept-Language":"ko-KR,ko"
    }
url="https://play.google.com/store/movies/top"

res= requests.get(url,headers=headers)
res.raise_for_status()
soup=BeautifulSoup(res.text,"lxml")

movies = soup.find_all("div",attrs={"class":"Vpfmgd"})
print(len(movies))

with open("movie.html","w",encoding="utf8") as f:
    f.write(soup.prettify())

#for movie in movies:
#    title = movie.find("div",attrs={"class":"WsMG1c nnK0zc"}).get_text()
#    print(title)