#coding=utf-8 import re import time import json import requests from selenium import webdriver from selenium.common.exceptions import TimeoutException from selenium.webdriver.common.by import By from selenium.webdriver.support.ui import WebDriverWait
在跑自动化时,页面上有2个下拉框,两个下拉框无论屏蔽哪一段都会成功,但是同时放开跑时会报错,百度给的解释是上面的下拉框元素覆盖了下面下拉框的元素定位,才会导致报错 百度的解决办法有2种: element = driver.find_element_by_css('div[class*="loadingWhiteBox"]')driver.execute_script("arguments[0].click();", element) element = driver