我试图自动登录到AliExpress.com,但找不到用户名和密码框。我在windows上使用带有Python 3的Selenium。到目前为止我已经试过了,这是一个开始:
driver = webdriver.Chrome(executable_path="C:/webdrivers/chromedriver")
driver.get('https://www.aliexpress.com')
driver.find_element_by_name("SearchText").send_keys("iphone 11")
driver.find_element_by_class_name("search-button").send_keys(Keys.ENTER)
driver.maximize_window()
继续进行的尝试是:
find_elements_by_class_name("login-content nc-outer-box")
或
fields = driver.find_elements_by_class_name("login-password")
或
fields = driver.find_elements_by_class_name("fm-field")
或
driver.find_element_by_class_name("input-plain-wrap input-wrap-loginid ").send_keys("blahblah@gmail.com")
driver.find_element_by_id("fm-login-password").send_keys("blahblah")
对于最初的50搜索AliExpress,让我看到结果之前,我不得不登录,但现在我不得不和我的所有尝试失败,有什么想法,我应该做什么?(每次我保存“字段”时,它的长度是0而不是2)
发布于 2019-10-14 15:04:53
为用户名和密码字段尝试以下选择器:
用户名选择器:
driver.find_element_by_css_selector("div.input-plain-wrap.input-wrap-loginid").send_keys("blahblah@gmail.com")
或
driver.find_element_by_css_selector("input#fm-login-id").send_keys("blahblah@gmail.com")
密码选择器:
driver.find_element_by_css_selector("div.input-plain-wrap.input-wrap-password").send_keys("password")
或
driver.find_element_by_css_selector("input#fm-login-password").send_keys("password")
https://stackoverflow.com/questions/58378505
复制相似问题