getElementById() takes exactly 1 argument (2 given)
<p>I want to do an automation of the Internet Explorer. Open the Internet Explorer, navigate to login.live.com and set a value into the email textbox.</p>

<p>Here's the simple script:</p>

<pre><code>import win32com.client
import time

IE = win32com.client.DispatchEx("InternetExplorer.Application")
IE.Visible = 1
IE.Navigate('login.live.com')

time.sleep(5)

DOC = IE.document
DOC.getElementById('i0116').value = 'test'
</code></pre>

<p>The last line always returns the following TypeError: </p>

<blockquote>
  <p>getElementById() takes exactly 1 argument (2 given)</p>
</blockquote>

<p>When I try to add the value through the console of the Internet Explorer it works.</p>

<p>Btw. the getElementsByTagName() method works without any Errors.</p>

<p>Thanks for any help!</p>

<p>Okay.. I wrote a workaround for this:</p>

<pre><code>DOC = IE.Document
inputs = DOC.documentElement.getElementsByTagName('input')

for field in inputs:
    if field.id == 'i0116':
        email = field
        break
email.value = 'example@test.com'
</code></pre>

<p>For browser automation I recommend to use the <a href="http://www.seleniumhq.org/" rel="nofollow">Selenium</a> library.</p>

python win32com