PDA

View Full Version : Why does my code not work Internet Explorer



KarinaE
04-15-2011, 11:21 AM
Hi, my code is supposed to automatically log in to a website. Please notice the http should be without the space obviously, but I cannot post links for some reason.

Dim ie As Object
Dim x As Single
Dim url As String
Set ie =CreateObject("InternetExplorer.Application")
url = "h ttp://careers.bankofamerica.com/director.asp?countryid=1&url=https%3a%2f%2fbacfhrs.taleo.net%2fcareersection%2fapplication.jss%3flan g%3den%26type%3d1%26csNo%3d2%26portal%3d140160497%26reqNo%3d878285%26postda ta%3d%24QEbCcxFGN7OUb1h-_JXJTg%3d%3d%26src%3d"

ie.navigate url
ie.visible = True

While ie.busy
DoEvents
Wend x = Timer

While Timer - x < 3
DoEvents
Wend

ie.document.getElementById(&quot;dialogTemplate-dialogForm-login-name1&quot;).Value = "email"

ie.document.getElementById(&quot;dialogTemplate-dialogForm-login-password&quot;).Value = "password"

ie.document.forms(0).submit This gives a error for ie.document.getElementById(&quot;dialogTemplate-dialogForm-login-name1&quot;).Value = "email"

"Object variable or With block variable not"

It has nothing to do with that the page is not fully loaded. Even after waiting 2 min before executing this statement, it gives me this error.

Kenneth Hobs
04-15-2011, 11:43 AM
The site limits you for the first few posts due to spammers most likely. The link is down right now. Once up, check the site's Page Source code to see if the element names that you submitted exist.

KarinaE
04-17-2011, 11:08 AM
The site limits you for the first few posts due to spammers most likely. The link is down right now. Once up, check the site's Page Source code to see if the element names that you submitted exist. Hi the page is not down, you have to get rid of the space in the "h ttp" that I put here to get around problem of not being able to post links. The elements I am trying to find exist in the source code on that website and are unique and it still does not work.

BrianMH
04-17-2011, 01:22 PM
The page your using has frames. Does it work if you use this link?

https://bacfhrs.taleo.net/careersection/iam/accessmanagement/login.jsf?lang=en&redirectionURI=https%3A%2F%2Fbacfhrs.taleo.net%2Fcareersection%2Fapplicatio n.jss%3Flang%3Den%26type%3D1%26csNo%3D2%26portal%3D140160497%26reqNo%3D8782 85%26postdata%3D%24QEbCcxFGN7OUb1h-_JXJTg%3D%3D%26src%3D&TARGET=https%3A%2F%2Fbacfhrs.taleo.net%2Fcareersection%2Fapplication.jss%3F lang%3Den%26type%3D1%26csNo%3D2%26portal%3D140160497%26reqNo%3D878285%26pos tdata%3D%24QEbCcxFGN7OUb1h-_JXJTg%3D%3D%26src%3D

KarinaE
05-17-2011, 07:24 AM
I don't know if that works, I need it to work on the original site. What are frames and how can I get around this problem using exactly this site?