htmlの「このサプライヤーの商品を注文する」ボタンをクリックしたいです。
html
<div class="orderAdvanceBtn btmMgnSet3"> <a href="javascript:void(0);" class="btnType01 btnColor01 btnEffects" onclick="javascript:buyCart(15914134);">このサプライヤーの商品を注文する<i class="fa fa-chevron-right leftMgnSet" aria-hidden="true"></i></a> </div>
pythonでボタンクリックするように書きました。
python
driver.find_element_by_css_selector('.btnType01.btnColor01.btnEffects').click()
うまくいかず、エラーになります。
VScode
c:\Users\mi_chan\Documents\tampopo\PSauto.py:89: DeprecationWarning: find_element_by_* commands are deprecated. Please use find_element() instead driver.find_element_by_css_selector('.btnType01.btnColor01.btnEffects').click() Exception in Tkinter callback Traceback (most recent call last): File "C:\Users\mi_chan\AppData\Local\Programs\Python\Python310\lib\tkinter\__init__.py", line 1921, in __call__ return self.func(*args) File "c:\Users\mi_chan\Documents\tampopo\PSauto.py", line 89, in btnURL_click driver.find_element_by_css_selector('.btnType01.btnColor01.btnEffects').click() File "C:\Users\mi_chan\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webelement.py", line 81, in click self._execute(Command.CLICK_ELEMENT) File "C:\Users\mi_chan\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webelement.py", line 710, in _execute return self._parent.execute(command, params) File "C:\Users\mi_chan\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 424, in execute self.error_handler.check_response(response) File "C:\Users\mi_chan\AppData\Local\Programs\Python\Python310\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 247, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable (Session info: chrome=96.0.4664.110) Stacktrace: Backtrace: Ordinal0 [0x00BF6903+2517251] Ordinal0 [0x00B8F8E1+2095329] Ordinal0 [0x00A92710+1058576] Ordinal0 [0x00ABE324+1237796] Ordinal0 [0x00AB4037+1196087] Ordinal0 [0x00AD64D3+1336531] Ordinal0 [0x00AB3A36+1194550] Ordinal0 [0x00AD65BA+1336762] Ordinal0 [0x00AE5BBF+1399743] Ordinal0 [0x00AD639B+1336219] Ordinal0 [0x00AB27A7+1189799] Ordinal0 [0x00AB3609+1193481] GetHandleVerifier [0x00D85904+1577972] GetHandleVerifier [0x00E30B97+2279047] GetHandleVerifier [0x00C86D09+534521] GetHandleVerifier [0x00C85DB9+530601] Ordinal0 [0x00B94FF9+2117625] Ordinal0 [0x00B998A8+2136232] Ordinal0 [0x00B999E2+2136546] Ordinal0 [0x00BA3541+2176321] BaseThreadInitThunk [0x765CFA29+25] RtlGetAppContainerNamedObjectPath [0x77337A9E+286] RtlGetAppContainerNamedObjectPath [0x77337A6E+238] [28248:11488:1221/150632.489:ERROR:gpu_init.cc(457)] Passthrough is not supported, GL is disabled, ANGLE is [16856:28156:1221/150640.235:ERROR:gpu_init.cc(457)] Passthrough is not supported, GL is disabled, ANGLE is
質問の仕方が下手ですみませんが、よろしくお願いいたします。
まだ回答がついていません
会員登録して回答してみよう