selenium을 이용한 스크래핑

ArecaCoco·2022년 3월 20일
0

기본세팅

from selenium import webdriver
from bs4 import BeautifulSoup
import time
from selenium.common.exceptions import NoSuchElementException
from pymongo import MongoClient
import requests

# 스크래핑한 정보 DB에 저장하기
client = MongoClient('IP', 27017, username="ID", password="PW")
db = client.dbsparta_plus_week3

driver = webdriver.Chrome('./chromedriver')

url = "스크래핑할 주소" 

driver.get(url)
time.sleep(5)

다양하게 응용해 봅시다.

profile
밝은냉정함

0개의 댓글