寻找正确的账号与密码
excel表中以部门编号为分类标准,分成了多个事项列表sheet,同时具有一张名为password的sheet,里面是所有部门的账号密码。
需要实现对所有事项进行网页操作,就需要:1.自动登录网站。2.自动查找事项。3.自动操作事项。4.自动上报事项。
1.自动登录网站
**自动寻找到正确的账号与密码
代码如下:
# coding = utf-8
import time
import openpyxl # 用于读写excel
import pyautogui as pag
import pytesseract
import xlwings as xw # 用于读写excel
from PIL import Image, ImageEnhance
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.common.by import By
print('请输入需要导入的文件路径:')
#寻找文件,如有错误重新尝试的循环
for n in range(1,4):
filepath = input()
try