我想使用硒登录instagram,但似乎无法在字段中输入值。
这是我的脚本:
#go to this address
browser.get('https://www.instagram.com')
#sleep for 1 seconds
sleep(1)
#find the 'login' button on homepage
login_elem = browser.find_element_by_xpath(
'//*[@id="react-root"]/section/main/article/div[2]/div[2]/p/a')
#navigate to login page
login_elem.click()
从这里开始遇到麻烦:
#locate the username field within the form
unform = browser.find_element_by_xpath(
'//*[@id="f3b8e6724a27994"]')
#clear the field
textunform.clear()
#enter 'test' into field
unform.send_keys('test')
慕村225694