当前位置:网站首页>Automatically fill in body temperature and win10 task plan

Automatically fill in body temperature and win10 task plan

2022-04-23 20:20:00 Install a sound 77

Because of the epidemic , Students who have started school need to fill in all kinds of temperature information , Multiple times a day on average , After forgetting to fill in, it is the telephone bombing of the counselor assistant .

Although this principle is good , But there is no doubt that it will eventually become formalism .

1. The purpose of the school is to screen out the students with hidden dangers of high temperature at the first time 2. The school does not have the ability to conduct a unified temperature test for all students 3. Healthy students don't have enough willingness to take their own temperature test 4. Students who are willing to have physical tests are more likely to be at risk . So obviously, it is more reasonable to establish a high-temperature reaction mechanism , Instead of patting your head and filling in , In the end, it bothered most people .

Forget it , That's not the point either

For this kind of questionnaire, star's Questionnaire , The process is very simple , There is no need to simulate login when filling in

It is usually forwarded to the group in this form

also url Long term non replacement , use selenium and python It's easy to achieve this goal , First import the following packages .

from selenium import webdriver
import time
from selenium.webdriver.support.ui import Select
import datetime

Use three-stage login

login_url = "https://www.wjx.top/XXXX"
driver = webdriver.Chrome()
driver.maximize_window()
driver.get(login_url)

Direct browser F12 Get into ,ctrl+shift+c Position to the front button The location of the text , With full xpath Direct copy

The next step is Text Button Fill in multiple boxes  

# Fill in text 
driver.find_elements_by_xpath('/html/body/div[2]/div[1]/div[2]/div[1]/div/div[1]/div[2]/div[2]/fieldset/div[3]/div[2]/textarea')[0].send_keys(tianru[0])
# Click button 
driver.find_elements_by_xpath('/html/body/div[2]/div[1]/div[2]/div[1]/div/div[1]/div[2]/div[4]/table/tbody/tr/td[1]/input')[0].click()
# choice   Locate the <select>
select = Select(driver.find_elements_by_xpath('/html/body/div[2]/div[1]/div[2]/div[1]/div/div[1]/div[2]/div[2]/fieldset/div[5]/div[2]/select')[0])
select.select_by_visible_text(zaowan[1])

In this way, the script is basically completed .

Next, design the script to start automatically , It was originally considered to be deployed to Alibaba cloud , however linux No, chrome So just use it. WIN10 The self-contained planned task is realized .

Click computer management Create tasks And fill in the time in the trigger

Then import the script you run

Automatic tasks can be completed .

 

版权声明
本文为[Install a sound 77]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204210551491325.html

随机推荐