코스피, 코스닥 가져오기
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