登录界面网址是:
https://quality.ncis.cn/platform-home
登录成功变成:
https://quality.ncis.cn/home
大类菜单网页:
https://quality.ncis.cn/report-disease/drgs
想要操作填写的页面网址是:
https://quality.ncis.cn/report-disease/drgs-detail?diseaseType=PIP&num=form-18&type=1&check=false
每次跳转,元素定位都出错。。请指教!
用代码块功能插入代码,请勿粘贴截图
```python
import time
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from PIL import Image
import pyautogui
import pytesseract
#options.add_argument('--headless')
driver = webdriver.Chrome()
driver.maximize_window() #第一种加载完成后最大化
driver.get('https://quality.ncis.cn/platform-home')
input('关闭弹窗后按任意键继续')
#点击进入登陆窗口
driver.find_element_by_xpath('//*[@id="app"]/div/div/div[2]/div/div[2]/div/div[1]').click()
time.sleep(2)
#输入账号密码
driver.find_element_by_xpath('//*[@id="app"]/div/div/div[2]/div/div[2]/div[2]/form/div[1]/div/div[1]/div[2]/input').send_keys('******')
driver.find_element_by_xpath('//*[@id="app"]/div/div/div[2]/div/div[2]/div[2]/form/div[2]/div/div/div[2]/input').send_keys('******')
input('手动输入验证码后按任意键继续')
#点击登录
driver.find_element_by_xpath('//*[@id="app"]/div/div/div[2]/div/div[2]/div[2]/form/div[5]/div/button[1]').click()
#登陆后网址变成https://quality.ncis.cn/home
url_1=driver.current_url
print(url_1)
#直接get()获取新url,结果页面自动跳回最初的登录url,就是重复上面的一轮。这一步怎么弄!!!
driver.get(url_1)
#这样还是获取不了元素
driver.find_element_by_xpath('//*[@id="app"]/div/div/div[1]/div/div[2]/ul/div[2]/li/div[1]/i').click()
###### 运行结果及报错内容
###### 我的解答思路和尝试过的方法
###### 我想要达到的结果