This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import win32com.client | |
| excel = win32com.client.Dispatch('Excel.Application') | |
| excel_file = excel.Workbooks.Open(r'C:\Users\한세영\Desktop\황성훈_엑셀파일\111.xlsx') | |
| work_sheet = excel_file.ActiveSheet | |
| work_sheet.Cells(3,4).select # cell select | |
| work_sheet.paste # paste | |
| excel.visible = True | |
| # Activesheet 변경방법 | |
| # work_sheet = excel_file.sheets(1) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from selenium import webdriver | |
| import time | |
| from bs4 import BeautifulSoup | |
| driver = webdriver.Chrome(r'C:\Users\한세영\Downloads\chromedriver_win32\chromedriver.exe') | |
| driver.get('http://www.naver.com') | |
| time.sleep(5) | |
| driver.find_element_by_id('id').send_keys('hunman23') | |
| driver.find_element_by_id('pw').send_keys('tjdgnse1') | |
| time.sleep(5) | |
| driver.find_element_by_xpath('''//*[@id="frmNIDLogin"]/fieldset/span/input''').click() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #Pywin32 설치필요함 link : https://sourceforge.net/projects/pywin32/files/pywin32/ | |
| import win32api,win32con,time | |
| time.sleep(2) | |
| # Windows상의 x좌표 | |
| x = 50 | |
| # Windows상의 y좌표 | |
| y = 250 | |
| win32api.SetCursorPos((x,y)) | |
| win32api.mouse_event(win32con.MOUSEEVENTF_LEFTDOWN,x,y,0,0) | |
| win32api.mouse_event(win32con.MOUSEEVENTF_LEFTUP,x,y,0,0) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| from bs4 import BeautifulSoup | |
| response = requests.get(r'http://www.kma.go.kr/weather/forecast/timeseries.jsp') | |
| response_text = BeautifulSoup(response.text,'html.parser') | |
| for x in response_text.find_all('img'): | |
| print(x['alt']) |