View Single Post
 
Old 07-07-2015, 11:35 AM
edneco edneco is offline Windows 7 32bit Office 2007
Novice
 
Join Date: Jun 2014
Posts: 12
edneco is on a distinguished road
Default

Hello again.....

Iīve found this code in the internet and modify it to suit me, but as a problem.....

I run the code and the IE open in the site I want by then donīt login..... Gives me an error.....

It says:

type Status report
message HTTP method POST is not supported by this URL
description The specified HTTP method is not allowed for the requested resource.


How can I fix this??? The code is this:


Code:
Dim HTMLDoc As HTMLDocument
Dim oBrowser As InternetExplorer
Sub Login_2_Website()

Dim oHTML_Element As IHTMLElement
Dim sURL As String

On Error GoTo Err_Clear
sURL = "https://www.betbrain.com/"
Set oBrowser = New InternetExplorer
oBrowser.Silent = True
oBrowser.timeout = 60
oBrowser.navigate sURL
oBrowser.Visible = True

Do
' Wait till the Browser is loaded
Loop Until oBrowser.readyState = READYSTATE_COMPLETE

Set HTMLDoc = oBrowser.document

HTMLDoc.all.UserName.Value = "******"
HTMLDoc.all.Password.Value = "********"

For Each oHTML_Element In HTMLDoc.getElementsByTagName("input")
If oHTML_Element.Type = "submit" Then oHTML_Element.Click: Exit For
Next

' oBrowser.Refresh ' Refresh If Needed
Err_Clear:
If Err <> 0 Then
Err.Clear
Resume Next
End If
End Sub

If anyone can help me on this......
Reply With Quote