如果网站是http://xkz.cbirc.gov.cn/jr/,reflush它,您将找到确认消息框
driver.get("http://xkz.cbirc.gov.cn/jr/")
wait = WebDriverWait(driver, 10)
table_yanZhengMa = wait.until(
EC.presence_of_element_located((By.XPATH, "/html/body/div[5]/table"))
visibilityMy = driver.find_element_by_id("show_msg").get_attribute('style')
print(visibilityMy)
if (visibilityMy.find("visibility: visible") >= 0):
print("需要输入验证码")
else:
tmpPrice = wait.until(
EC.presence_of_all_elements_located(
(
By.XPATH,
"/html/body/div[3]/div/div[2]/div/div[1]/div/div[1]/div[2]/div/div[1]/table/tbody/tr/td[5]/div/a"#"//div[@class='sku-name']", 价格
)
)
)
print(tmpPrice[0].text)
print(driver.find_element_by_id("queryResult").text)
您可以刷新页面以执行此操作
问题解决了,因为我使用Firefox浏览器。如果我使用chrome,这个问题就不会再出现了。但是为什么firefox会导致这个问题,我不知道!有人知道吗
相关问题 更多 >
编程相关推荐