Selenium webdriver python未在密码字段中键入

2024-09-28 13:44:49 发布

您现在位置:Python中文网/ 问答频道 /正文

我做了这个代码,它的工作,唯一的问题是当输入密码字段。什么都没出现。你能帮帮我吗?你知道吗

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import threading

userStr = '555555'
passwordStr = '555555'

browser = webdriver.Chrome()
browser.get(('https://www30.mercantilbanco.com/olb/Login'))

username = browser.find_element_by_css_selector('#userId')
username.send_keys(userStr)

password = browser.find_element_by_css_selector('#password')
username.send_keys(passwordStr)

Tags: fromimportbrowsersendsupportbyseleniumusername

热门问题