login into website
-
How can I log into a website. Lets take as an example, logging into codeproject.com. I have: Dim objIE Set objIE = WScript.CreateObject("InternetExplorer.Application") objIE.Navigate "http://www.codeproject.com" objIE.Visible = true While objIE.Busy = true Wend objIE.Document.All("Email").Value = "brinasas@yahoo.com" objIE.Document.All("Password").Value = "xxxxxx" objIE.Document.All("button").Click 'Dim Wsh : set Wsh = CreateObject("WScript.Shell") 'Wsh.SendKeys "{ENTER}" But the above script gives me an error. Any feedback anyone can give me will be greatly appreciated.
-
How can I log into a website. Lets take as an example, logging into codeproject.com. I have: Dim objIE Set objIE = WScript.CreateObject("InternetExplorer.Application") objIE.Navigate "http://www.codeproject.com" objIE.Visible = true While objIE.Busy = true Wend objIE.Document.All("Email").Value = "brinasas@yahoo.com" objIE.Document.All("Password").Value = "xxxxxx" objIE.Document.All("button").Click 'Dim Wsh : set Wsh = CreateObject("WScript.Shell") 'Wsh.SendKeys "{ENTER}" But the above script gives me an error. Any feedback anyone can give me will be greatly appreciated.
Why is it noone ever thinks the error message is an important detail to put into a post concerning the non-functioning of a piece of code?
A guide to posting questions on CodeProject[^]
Dave Kreskowiak -
Why is it noone ever thinks the error message is an important detail to put into a post concerning the non-functioning of a piece of code?
A guide to posting questions on CodeProject[^]
Dave KreskowiakThe error says: Line: 10 Char: 1 Error: Object required: 'Document.All(...)' Code: 800A01A8 Source: Microsoft VBScrpt runtime error Line 10 is this line: objIE.Document.All("Email").Value = "brinasas@yahoo.com" Any response you can give me will be greatly appreciated.
-
How can I log into a website. Lets take as an example, logging into codeproject.com. I have: Dim objIE Set objIE = WScript.CreateObject("InternetExplorer.Application") objIE.Navigate "http://www.codeproject.com" objIE.Visible = true While objIE.Busy = true Wend objIE.Document.All("Email").Value = "brinasas@yahoo.com" objIE.Document.All("Password").Value = "xxxxxx" objIE.Document.All("button").Click 'Dim Wsh : set Wsh = CreateObject("WScript.Shell") 'Wsh.SendKeys "{ENTER}" But the above script gives me an error. Any feedback anyone can give me will be greatly appreciated.
-
The error says: Line: 10 Char: 1 Error: Object required: 'Document.All(...)' Code: 800A01A8 Source: Microsoft VBScrpt runtime error Line 10 is this line: objIE.Document.All("Email").Value = "brinasas@yahoo.com" Any response you can give me will be greatly appreciated.
That would be because Document.All("Email") didn't return an object. This means you cannot set the Value property of an object that doesn't exist. You may want to check to see if that code returned an object before you try and use it.
Dim c Set c = objIE.Document.All("Email") If c Is Nothing Then ' A control called "Email" doesn't exist in the page! ' Handle this condition appropriately. Else c.Value = "blah@somewhere.net" End If
A guide to posting questions on CodeProject[^]
Dave Kreskowiak