python+win32+ie浏览器操作 TypeError: getElementById() takes exactly 1 argument (2 given)

使用body操作

# -*- coding:UTF-8 -*-
 
import win32com.client
from time import sleep
 
 
 
second=win32com.client.DispatchEx("InternetExplorer.Application")
second.Navigate('http://passport.cnblogs.com/login.aspx')
second.Visible=1
while second.Busy:
    sleep(1)
 
doc=second.Document
body=doc.body
#doc.getElementById("login")
 
for i in body.getElementsByTagName("input"):
    if i.id=='input1':
        i.value='13816407285'
    if i.id=='input2':
        i.value='59459540a'
 
for i in body.getElementsByTagName("input"):
    if i.id=='signin':
        i.click()
        print('click')
原文地址:https://www.cnblogs.com/sea-stream/p/10362601.html