网页中自动弹出的对话框要怎么定位呢?
如图,打开这个网站后,自动弹出的登录框,我想定位“账号密码登录”,并点击。代码尝试如下,但是失败了
div = driver.find_element_by_class_name('link').find_element_by_id('switcher_plogin')
div.click()
错误信息如下:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"class name","selector":"link"}
(Session info: chrome=60.0.3112.7)
(Driver info: chromedriver=2.31.488763 (092de99f48a300323ecf8c2a4e2e7cab51de5ba8),platform=Windows NT 6.3.9600 x86_64)