我有困難www.meridiancu.ca訪問下拉菜單。這是在主頁右側的「選擇銀行類型」下的那個。一旦我運行我的代碼。硒發現隱藏的元素
from selenium import webdriver
from selenium.webdriver.common import action_chains, keys
import time
driver = webdriver.Chrome()
driver.maximize_window()
driver.get("http://www.meridiancu.ca")
bank_type = driver.find_element_by_id('SelectAccount')
bank_type.click()
我得到以下輸出,我不知道如何找到這個「隱藏」元素。
DevTools listening on ws://127.0.0.1:12015/devtools/browser/6f5fba77-4c41-49b9-93a3-64a8363cd35b
Traceback (most recent call last):
File "C:\Users\Imad\Documents\Programming\Python\dropdown select.py", line 14, in <module>
bank_type.click()
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webelement.py", line 80, in click
self._execute(Command.CLICK_ELEMENT)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webelement.py", line 501, in _execute
return self._parent.execute(command, params)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 308, in execute
self.error_handler.check_response(response)
File "C:\Python27\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 194, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotVisibleException: Message: element not visible
(Session info: chrome=62.0.3202.94)
(Driver info: chromedriver=2.33.506120 (e3e53437346286c0bc2d2dc9aa4915ba81d9023f),platform=Windows NT 10.0.16299 x86_64)
任何建議或解決方案將不勝感激。
是我的回答有幫助嗎?如果是 - 請在我的答案附近檢查一下打勾。 –