title: Input text into textarea for codemirror python selenium
body: <p>I am new to selenium and trying to input text into a textarea generated by CodeMirror. I have looked at the other questions on textarea and am unable to solve my problem.</p>
  
  <p>I am using Chrome and have found in sources where the textarea is and am able to click it to have the cursor blinking. However, I find that it has no attributes. How can I input text into the textarea? I have tried other elements and I have gotten either a "can't focus" or "not visible" error which I am guessing means that those elements are not the textarea.</p>
  
  <pre><code>a= browser.find_element_by_css_selector('div.CodeMirror.CodeMirror-wrap.dojoDndTarget.cm-s-sql.dojoDndContainer').click()
  print a
  None
  </code></pre>
  
  <p>I realize that adding a long source code is probably inconvenient for other users but I am not sure which CodeMirror line may refer to the textarea and am posting it for completeness. Here is the source code as well as the screenshot.</p>
  
  <p><a href="https://i.stack.imgur.com/emrpe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/emrpe.png" alt="enter image description here"></a></p>
  
  <pre><code>&lt;div class="CodeMirror CodeMirror-wrap dojoDndTarget cm-s-sql dojoDndContainer" style="font-size: 12px; font-weight: normal;"&gt;
  &lt;div style="overflow: hidden; position: relative; width: 3px; height: 0px; top: 4px; left: 4px;"&gt;
  &lt;textarea autocorrect="off" autocapitalize="off" spellcheck="false" style="position: absolute; padding: 0px; width: 1000px; height: 1em; outline: none;" tabindex="0"&gt;
  &lt;/textarea&gt;
  &lt;/div&gt;
  &lt;div class="CodeMirror-vscrollbar" not-content="true" style="min-width: 18px;"&gt;
  &lt;div style="min-width: 1px; height: 0px;"&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="CodeMirror-hscrollbar" not-content="true" style="min-height: 18px;"&gt;
  &lt;div style="height: 100%; min-height: 1px; width: 0px;"&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="CodeMirror-scrollbar-filler" not-content="true"&gt;
  &lt;/div&gt;
  &lt;div class="CodeMirror-gutter-filler" not-content="true"&gt;
  &lt;/div&gt;
  &lt;div class="CodeMirror-scroll" tabindex="-1"&gt;
  &lt;div class="CodeMirror-sizer" style="margin-left: 0px; margin-bottom: 0px; border-right-width: 30px; min-height: 24px; padding-right: 0px; padding-bottom: 0px;"&gt;
  &lt;div style="position: relative; top: 0px;"&gt;
  &lt;div class="CodeMirror-lines"&gt;
  &lt;div style="position: relative; outline: none;"&gt;
  &lt;div class="CodeMirror-measure"&gt;
  &lt;/div&gt;
  &lt;div class="CodeMirror-measure"&gt;
  &lt;/div&gt;
  &lt;div style="position: relative; z-index: 1;"&gt;
  &lt;/div&gt;
  &lt;div class="CodeMirror-cursors" style=""&gt;
  &lt;div class="CodeMirror-cursor" style="left: 4px; top: 0px; height: 16px;"&gt;&amp;nbsp;&lt;/div&gt;&lt;/div&gt;&lt;div class="CodeMirror-code"&gt;
  &lt;pre class=""&gt;
  &lt;span style="padding-right: 0.1px;"&gt;
  &lt;span&gt;
  &lt;/span&gt;
  &lt;/span&gt;
  &lt;/pre&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;div style="position: absolute; height: 30px; width: 1px; top: 24px;"&gt;&lt;/div&gt;&lt;div class="CodeMirror-gutters" style="display: none; height: 197px;"&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Thanks.</p>