import webbrowser import time import pyperclip import pyautogui
webbrowser.open("https://www.kores.net/komis/price/mineralprice/basemetals/pricetrend/baseMetals.do") time.sleep(2)
# [광종선택] 컨텍스트박스 선택 pyautogui.moveTo(859, 427, duration = 0.7) time.sleep(2) pyautogui.click()
# '알루미늄' 선택 pyautogui.moveTo(821, 493, duration = 0.7) time.sleep(1) pyautogui.click() time.sleep(1)
# [기간선택] 1년 선택 pyautogui.moveTo(1211, 460, duration = 0.7) time.sleep(1) pyautogui.click() time.sleep(1)
# [검색] 버튼 클릭 pyautogui.moveTo(1381, 490, duration = 0.7) time.sleep(1) pyautogui.click() time.sleep(3)
# 마우스 스크롤 아래로 내리기 pyautogui.scroll(-1000)
# 엑셀 다운로드 이미지 경로 image_path = "C:\\rpa\\excel_download.png"
# 엑셀 다운로드 버튼 누르기 location = pyautogui.locateOnScreen(image_path, confidence = 0.6) x, y = pyautogui.center(location)
pyautogui.moveTo(x, y, duration = 0.7) pyautogui.click() time.sleep(2) |