After reading "Getting Started with Python Programming", I wrote a small script to complete the automatic input of 12306 login data. as follows:
1 import webbrowser 2 import pyautogui 3 import time 4 5 6 href = r'kyfw.12306.cn/otn/login/init' 7 br_path = r'C:\Program Files\Mozilla Firefox\firefox.exe' 8 pyautogui.hotkey('win', 'd') 9 webbrowser.BackgroundBrowser(br_path).open(href) 10 time.sleep(6) 11 pyautogui.click(390, 242) # replace it with your coodinate. 12 Data = [] # input your data 13 for v in Data: 14 pyautogui.typewrite(v) 15 pyautogui.press('enter') 16 pyautogui.typewrite(['tab'])
I feel that this automation method is still not concise enough for different page formats, but I just think it is very interesting, and it exists here.