I'm trying to get some data from a website in order to update an excel sheet.
I have managed to do it by using an internet explorer object but it is slow.
I'm now trying to do it using either an xmlhttp request or a winhttp request or the fastest of these two if one of them is faster. Or anything faster than an IE object.
The context :
To acces the data I need there are multiples forms I need to fill after logging in.
The website follow this path.
Url 1 > Login page
Url 2 > First form(Chose country)
Url 2 > Loads then, Another form(Bike or Car)
And so on. I have 4 form to fill and 3 url before having access to the data. Each form is dependent of the previous one. In order to simplify for now let's say I want to navigate a fixed path.
I think the website use frames as the url stay the same but the page loads another form & another style after selecting the value of the first form.
I'm lost here.
I have managed to get the page after the log in using a POST. but can't navigate within the site after. When I try to GET any of the subsequent pages I need, I'm getting the login page as response text. Same for POST to a form.
My ideas:
- Storing the login cookie ? I did that :
strCookie = xml.getResponseHeader("Set-Cookie")
...
.setRequestHeader "Cookie", strCookie
>It does not work.
- Calling the last page where the data is with all forms data in my
POST
>Gives me the page after the login as responsetext
Questions :
1) Where should I look at in order to do what I want?
2) Are the website frames a problem ? This may sound stupid but, how can they have two different pages at the same url ?
3) How can the previous form value be stored and where ?
4) I saw these 3 threads, and I'm confident they have the solution. It's a shame I don't understand them.
VBA Macros MSXML2.XMLHTTP Login
Login into website using MSXML2.XMLHTTP instead of InternetExplorer.Application with VBA
VBA XMLHTTP Pagination Issue - Can't get past the second page of search results