How to Auto-fill web forms
Posted on July 26, 2011
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 | 'Internet - How to Auto-fill web forms Option Explicit 'set references for "Microsoft Internet controls" and "Microsoft HTML Object library". Private WithEvents strtxtBox As HTMLTextAreaElement Private IE As InternetExplorer Private WithEvents strEmail As HTMLTextAreaElement Private Sub Command1_Click() Set IE = New InternetExplorer With IE .Visible = True .navigate "www.gamespot.com" End With Do Until IE.ReadyState = READYSTATE_COMPLETE DoEvents Loop 'the following lines will use the text box names from the site to identify the '<input type="text" name="EMAILADDR" class="mr5" style="width:100px;" Set strtxtBox = IE.document.Forms(0).PASSWORD Set strEmail = IE.document.Forms(0).EMAILADDR strtxtBox.innerText = "pass" strEmail.innerText = "email@hotmail.com" IE.document.frames.execScript "document.login.submit()", "JavaScript" End Sub |