0

I am trying to fill out a login form on https://login.alibaba.com/?spm=a2700.8293689.0.0.EKYnH1&tracelog=hd_signin. However i am unable to fill out the login form. Here is my current code.

executable_path = 
{'executable_path':'path/to/chrome/on/my/pc'}

browser = Browser('chrome', **executable_path)
browser.visit('https://alibaba.com')


my_acc = browser.find_link_by_partial_text("My Account")
for i in my_acc:
    browser.visit(i['href'])

browser.find_by_name('loginId').first.type('Steve Jobs')

I have checked the html code, and there is clearly an element with the name i am looking for, however i get the following error:

splinter.exceptions.ElementDoesNotExist: no elements could be found with name "loginId"
4

1 回答 1

0

当 selenium 尝试访问元素时,页面可能没有完全加载。作为选项,您可以使用睡眠功能。

import time
time.sleep(5) # delay for 5 seconds

你也可以检查这个硒

http://www.seleniumhq.org/docs/04_webdriver_advanced.jsp#explicit-and-implicit-waits

于 2017-05-25T00:22:30.027 回答