• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Using POST method login to website getting login error

Hi All,

Hope you all doing well. I request you all for a little help to login into any website using post method and then doing web scraping. will be thankful if any help on this query.

Thank you so much all.



Here is the code:

Dim oReq As Object
Dim url As String
Set oReq = CreateObject("MSXML2.XMLHttp")

url = "https://www.abc.com/signin/u/"
With oReq
.Open "POST", url, False
.setRequestHeader "Content-Type", "application/x-www-form-urlencoded"
.send "method=login&handle=cautionmp&pass=*"



End With
Set oReq = Nothing


Ap
 
This...
login into any website

Isn't possible. Each web site has it's own authentication process (though there are few popular ones) and there's no code that's going to be able to login to every site.

For an example, Google uses OAUTH2, where as some other website may use back-end DB to authenticate.

You will need to study each website and how the requests are handled and how it's sent.
 
This...


Isn't possible. Each web site has it's own authentication process (though there are few popular ones) and there's no code that's going to be able to login to every site.

For an example, Google uses OAUTH2, where as some other website may use back-end DB to authenticate.

You will need to study each website and how the requests are handled and how it's sent.


Hi Chihiro, Thanks for your response and Thanks for this knowledge! I haven't idea to check a my website how its send and handle the request. could you please help me out?

Thank you!
 
Dear Mark,
I have user ID and password of a website and wanted to login using post method in VBA and do some web scraping but I am not able to login.
I tried to do it using post method but it's not working. So what would be correct code? How can I login into website if I have user ID and password of a website and then I can do web scraping. Hope this crystal clear. Thank you!
 
@Ramesh Deo, to be more specific there are no hard and fast rules for arranging a POST request parameter which will be applicable for all the websites. Every website is individual so the parameter of a POST request meant to be created for a certain web won't fit for another unless they are identical. However, chances are very low if you try to consider that possibility.
 
@Ramesh Deo, to be more specific there are no hard and fast rules for arranging a POST request parameter which will be applicable for all the websites. Every website is individual so the parameter of a POST request meant to be created for a certain web won't fit for another unless they are identical. However, chances are very low if you try to consider that possibility.

Thank you Shahin for your suggestion!!
 
Back
Top