Я хочу использовать питон селена для нажатия кнопки, но ошибка, ниже приведен мой код питона для нажатия кнопки:
br.find_element_by_css_selector("span[id^='rallybutton-1121-btnIconEl']").click()
ИЛИ
br.find_element_by_xpath('//*[@id="rallybutton-1121-btnIconEI"]').click()
ИЛИ
br.find_element_by_xpath('//*[@id="rallybutton-1121"]').click()
И т. Д. Также не работает
И ниже находится мой элемент проверки:
<a class="x4-btn secondary rly-small x4-unselectable x4-btn-default-small x4-icon x4-btn-icon x4-btn-default-small-icon" style="float:right;border-width:0;" hidefocus="on" unselectable="on" tabindex="0" id="rallybutton-1121" role="button">
<span id="rallybutton-1121-btnWrap" role="presentation" class="x4-btn-wrap" unselectable="on"><span id="rallybutton-1121-btnEl" class="x4-btn-button" role="presentation">
<span id="rallybutton-1121-btnInnerEl" class="x4-btn-inner x4-btn-inner-center" unselectable="on"> </span>
<span role="presentation" id="rallybutton-1121-btnIconEl" class="x4-btn-icon-el icon-export " unselectable="on" style=""> </span>
</span>
</span>
</a>
![enter image description here](https://i.stack.imgur.com/N8L88.jpg)
Моя кнопкавыглядят так:
![enter image description here](https://i.stack.imgur.com/P7oFh.jpg)
И я хочу нажать Экспорт в CSV ...
![enter image description here](https://i.stack.imgur.com/yd0lZ.jpg)
Ошибка:
Traceback (most recent call last):
File "C:\Users\SMANE\Desktop\ShiJieTest\ShIJieRally.py", line 54, in <module>
#br.find_element_by_id('rallybutton-1121').click()#rallybutton-1084-btnIconEl
File "C:\Python37\lib\site-packages\selenium\webdriver\remote\webelement.py", line 80, in click
self._execute(Command.CLICK_ELEMENT)
File "C:\Python37\lib\site-packages\selenium\webdriver\remote\webelement.py", line 628, in _execute
return self._parent.execute(command, params)
File "C:\Python37\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 320, in execute
self.error_handler.check_response(response)
File "C:\Python37\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotVisibleException: Message: element not interactable
(Session info: chrome=69.0.3497.100)
(Driver info: chromedriver=2.42.591088 (7b2b2dca23cca0862f674758c9a3933e685c27d5),platform=Windows NT 10.0.16299 x86_64)