質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

Q&A

解決済

1回答

572閲覧

selenium 「要素は操作できません」

kakini

総合スコア40

Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

0グッド

0クリップ

投稿2022/12/17 07:04

環境win10
python3.9

あるサイトにログインする為にseleniumを使って要素を取得して
idとパスワードを入力したいのですが、文字列を送ろうとすると
「要素は操作できません」というエラーが出ます
何がいけないのでしょうか

python

1import time 2import datetime as dt 3import pyautogui as pgui 4import ctypes 5from selenium import webdriver 6from selenium.webdriver.support.ui import Select 7from selenium.webdriver.support.select import Select 8 9 10driver_path = "c:/driver/chromedriver.exe" 11global driver 12driver = webdriver.Chrome(driver_path) 13driver.maximize_window() 14driver.get("https://fx.ctfx.jp/mplus/mypage/frm2010/") 15time.sleep(3) 16 17ID = driver.find_element_by_name("USERID") 18ID.send_keys("aaaa") 19pas = driver.find_element_by_name("PASSWORD") 20pas.send_keys("aaaa") 21btn = driver.find_element_by_id("btn_login") 22btn.click()

出て来たエラーはこちらになります
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
ID.send_keys("aaaa")
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 477, in send_keys
self._execute(Command.SEND_KEYS_TO_ELEMENT,
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webelement.py", line 633, in _execute
return self._parent.execute(command, params)
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 321, in execute
self.error_handler.check_response(response)
File "C:\Users\user\AppData\Local\Programs\Python\Python39\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 242, in check_response
raise exception_class(message, screen, stacktrace)
selenium.common.exceptions.ElementNotInteractableException: Message: element not interactable
(Session info: chrome=108.0.5359.124)

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

guest

回答1

0

自己解決

フレーム移動をしたらそれ以降の操作も出来たので解決しました

投稿2022/12/17 07:29

kakini

総合スコア40

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問