Prompt Title: 자동 로그인 프로그램

Created 11 months ago
Votes 0
Views 130 times
0

Prompt Detail:

아이디와 비밀번호가 미리 정해져 있다고 가정하고, 파이썬으로 아이디와 비밀번호를 자동으로 입력하는 매크로를 만들어보겠습니다.

python
import pyautogui import time # 아이디와 비밀번호를 변수에 저장합니다. ID = 'your_id' PW = 'your_password' # 로그인 페이지로 이동합니다. pyautogui.hotkey('ctrl', 't') pyautogui.typewrite('https://www.example.com/login') pyautogui.press('enter') # 아이디 입력란을 클릭합니다. time.sleep(2) pyautogui.click(x=500, y=300) # 아이디를 입력합니다. pyautogui.typewrite(ID) # 비밀번호 입력란을 클릭합니다. pyautogui.click(x=500, y=400) # 비밀번호를 입력합니다. pyautogui.typewrite(PW) # 로그인 버튼을 클릭합니다. pyautogui.click(x=600, y=500) # 로그인이 완료될 때까지 잠시 기다립니다. time.sleep(3) # 브라우저를 종료합니다. pyautogui.hotkey('ctrl', 'w')

위 코드를 실행하면, 자동으로 아이디와 비밀번호를 입력하고 로그인 버튼을 클릭하여 로그인을 수행합니다. 이때, pyautogui 모듈을 사용하여 마우스와 키보드를 제어합니다. 예를 들어, pyautogui.click(x=500, y=300)는 마우스를 (500, 300) 위치로 이동시킨 후 클릭하는 것을 의미합니다. pyautogui.typewrite('your_id')는 키보드로 'your_id'를 입력하는 것을 의미합니다.

avatar
Shin
Shared 3 prompts
Created 11 months ago

Leave a Comment

Related Tag Prompts

271
0
Python Pro
1 year ago 2023-01-19 05:16:28 AIPRM
0
0
MySQL Database Creation.
1 year ago 2023-03-08 12:23:48 Pub
0
0
Cool stuff
1 year ago 2023-03-08 15:49:26 Sivayogeith
0
0
Bajar version de python
1 year ago 2023-03-09 10:48:33 Juanma
0
0
Frappe
1 year ago 2023-03-11 01:40:59 KuuKuu
0
0
0
0
python remote control server
1 year ago 2023-03-11 23:05:25 V0rt
0
0
output
1 year ago 2023-03-14 07:09:17 yuvaraj
0
0
s-parameter processing in python
1 year ago 2023-03-14 14:46:13 jhdo
0
0
Python Landsat data handling.
1 year ago 2023-03-15 13:10:40 nathan
0
0
Python para Ciencia Datos
1 year ago 2023-03-16 08:24:10 pedro
0
0
Following Rotated Logfiles.
1 year ago 2023-03-17 09:05:24 hamid
0
0
Modelo de Negócio.
1 year ago 2023-03-18 01:35:57 reiu
0
0
Django API for Todo
1 year ago 2023-03-18 17:45:33 AbdAlmjed
0
0
python爬虫
1 year ago 2023-03-21 00:23:14 DDL
0
0
Improvment_product_generator
1 year ago 2023-03-21 10:01:17 Matěj Konečný