前提・実現したいこと
Python3 + Selenium で IE から Yahooメールを送信したい。
発生している問題・エラーメッセージ
宛先まで入力できたが、本文が入力できない。
1.本文入力のiframeは取得できたが、その子要素(html/body/...)が取得できない。
2.send_key(Keys.TAB)で本文入力画面をアクティブにしても、send_key('XXX')を実行するとエラーになる。
エラーメッセージ 1.iframe.find_elementXXXでNoSuchElementExceptionが発生する。 2.send_key('XXX')のところでElementNotInteractableExceptionが発生する。
該当のHTML
<iframe width="100%" height="100%" title="メール本文" src="javascript:;" border="0" frameborder="0" marginwidth="0" marginheight="0" style="border: 1px solid rgb(238, 238, 238); border-image: none; visibility: inherit;" allowtransparency="true" topmargin="0" leftmargin="0"></iframe> <!DOCTYPE html> <html class="yui-js-enabled" id="yui_3_2_0_3_153313303821253" lang="en-US" dir="ltr"><head><title>Rich Text Editor</title><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=7"><base href="https://jp.mg5.mail.yahoo.co.jp/neo/"><style id="editor_css">body { background-color: #fff; } a, a:visited, a:hover { color: blue !important; text-decoration: underline !important; cursor: text !important; } img { cursor: pointer !important; border: none; }</style><style id="extra_css">html {height: 100%;}body { color: undefined; background-color: undefined;padding: 0px; margin: 8px 0px 0px 12px; height: 80% !important; } p { margin : 0 }blockquote { margin : 1em; display : block; }span.mark { background:transparent url(http://mail.yimg.com/ok/u/assets/img/rte-mark.png) repeat-x scroll center bottom; }</style><style type="text/css"></style></head><body id="yui_3_2_0_3_153313303821244" style="font-family: MS Gothic,monospace; font-size: 16px; display: block;" aria-label="メール本文"><p id="yui_3_2_0_3_153313303821236"><br></p><p id="yui_3_2_0_3_153313303821246"><br></p><p id="yui_3_2_0_3_153313303821248"><br></p><p id="yui_3_2_0_3_153313303821250">aaaaaaaa<br class="yui-cursor" id="yui_3_2_0_3_153313303821234"></p></body></html>
あなたの回答
tips
プレビュー