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

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

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

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

Q&A

解決済

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

kakini
kakini

総合スコア38

Python 3.x

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

1回答

0グッド

0クリップ

309閲覧

投稿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)

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

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

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

下記のような質問は推奨されていません。

  • 質問になっていない投稿
  • スパムや攻撃的な表現を用いた投稿

適切な質問に修正を依頼しましょう。

回答1

0

自己解決

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

投稿2022/12/17 07:29

kakini

総合スコア38

下記のような回答は推奨されていません。

  • 質問の回答になっていない投稿
  • スパムや攻撃的な表現を用いた投稿

このような回答には修正を依頼しましょう。

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

ただいまの回答率
86.02%

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

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

質問する

関連した質問

同じタグがついた質問を見る

Python 3.x

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