[python] 네이버 환율 크롤링

go easy on NG·2023년 1월 2일
0

토이 프로젝트

목록 보기
6/8

코스피, 코스닥 가져오기

from selenium import webdriver
import os
from selenium.webdriver.common.by import By
print(os.getcwd())
path = ""

browser = webdriver.Chrome()
browser.get("https://www.naver.com/")


browser.find_element(By.ID, 'query').click()
browser.find_element(By.ID, 'query').send_keys("증권")
browser.find_element(By.ID, 'search_btn').click()
csp=browser.find_element(By.CLASS_NAME, 'csp').text
csd=browser.find_element(By.CLASS_NAME, 'csd').text
print(csp)
print(csd)

while(1):pass

환율 가져오기

from selenium import webdriver
import os
from selenium.webdriver.common.by import By
print(os.getcwd())
path = ""

browser = webdriver.Chrome()
browser.get("https://www.naver.com/")

browser.find_element(By.ID, 'query').click()
browser.find_element(By.ID, 'query').send_keys("환율")
browser.find_element(By.ID, 'search_btn').click()
gr=browser.find_element(By.CLASS_NAME, 'rate_table_info').text
print(gr)

while(1):pass
profile
🐥개발자

0개의 댓글