Question : How to get past login page strRequestHTML Post

I am trying to run the below in vb excel to auto login into a local intranet site to run some url post to perform some functions. However i cant seem to get past the login page (i dont have access to the web site its a packaged site and i dont know the tech people). Looking at the source code for the page it has two inputs userid and userpassword. As you can see from my code below i have tried adding the details of the user etc to the web url but it just diverts to an error page.

Does anyone have any suggestions?




Dim strRequestHTML


Set objHTMLDoc = CreateObject("HTMLFILE")
Set objXMLHTTP = CreateObject("Msxml2.XMLHTTP.5.0")



With objXMLHTTP

strRequestHTML = "http://mywebsite.com/login.do"
        .Open "POST", strRequestHTML, False
        .setRequestHeader "Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"
        .send



    strRequestHTML = "http:mywebsite.com/home.do"
        .Open "POST", strRequestHTML, False
        .setRequestHeader "Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"
        .send

        strRequestHTML = strRequestHTML & "?userid=user&userpassword=password"

        .Open "POST", strRequestHTML, False
        .setRequestHeader "Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"
        .send



MsgBox .responsetext




End With
Set objHTMLDoc = Nothing

Answer : How to get past login page strRequestHTML Post

Hmm

Perhaps this one is better since it sets the content-length

http://authors.aspalliance.com/stevesmith/articles/netscrape2.asp
Random Solutions  
 
programming4us programming4us