我想使用硒登錄instagram,但似乎無法在字段中輸入值。這是我的腳本:#go to this addressbrowser.get('https://www.instagram.com')#sleep for 1 secondssleep(1)#find the 'login' button on homepagelogin_elem = browser.find_element_by_xpath('//*[@id="react-root"]/section/main/article/div[2]/div[2]/p/a')#navigate to login pagelogin_elem.click()從這里開始遇到麻煩:#locate the username field within the formunform = browser.find_element_by_xpath('//*[@id="f3b8e6724a27994"]')#clear the fieldtextunform.clear()#enter 'test' into fieldunform.send_keys('test')
使用Selenium和WebDriver(Chrome)Python OSX在Instagram
慕田峪7331174
2019-12-07 14:03:24