
%matplotlib inline
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
from selenium import webdriver
from selenium.webdriver.chrome.service import Service
from webdriver_manager.chrome import ChromeDriverManager
from bs4 import BeautifulSoup
import re
def set_chrome_driver():
chrome_options = webdriver.ChromeOptions()
driver = webdriver.Chrome(service=Service(ChromeDriverManager().install()), options=chrome_options)
return driver
excutabel_path = "chromedriver.exe"
source_url = "https://movie.naver.com/movie/sdb/rank/rmovie.naver"
driver = webdriver.Chrome(executable_path="C:/\chromedriver.exe")
driver.get(source_url)
req = driver.page_source

soup = BeautifulSoup(req, "html.parser")
contents_table = soup.select(".title .tit3 a")
contents_table

i = 0
for content in contents_table:
title = content.attrs['title']
src = content.attrs['href']
i+=1
print("{}, {} => {}".format(i,title,src))