I need to import a table from the stats page within our Yahoo Store, normally this would be easy, however yahoo is doing
the following to the page:
1. Page URL changes everytime you log into the website
1.1 - Solved by navigating to the page with script1(see footnotes)
2. Once on the correct page, the form name changes everytime the page is loaded
2.1 - There is however, only one form on the page.
3. The names of the form options change everytime the form is submitted.
What am I trying to do?
1 - Submit the form so that it only displays the last 10 days (rather that the default 365 days) using VBA
2 - Importing the form that loads into Excel
I tried using InStr to find the form name, this is what I have so far:
sPage = IE.document.body.InnerHTML
iFormName = InStr(1, sPage, "name=")
iFormNameEnd = InStr(iFormName, sPage, ">")
About the form:
1. The form name always has a fF before the number
2. There are always three imput values, starting with the Submit(Value=show)
3. The two radio button names are incemented from the submit
(eg. Submit(Name=F410), then the next two names would be F411 and F412)
4. This is the only form on the page.
Thank you.
Simon.
Footnotes:
Script1 which loads the page with the form below:
Sub importStats()
'Microsoft HTML Objects Library
'Microsoft Internet Controls
Dim IE As New InternetExplorer
Dim Cible As HTMLAnchorElement
Dim Doc As HTMLDocument
Dim sPage As String
Dim iFormName As Long, iFormNameEnd As Long
Dim iStart As Long, iEnd As Long
Dim iForm As Long
IE.Visible = True
IE.Navigate "http://<STORE URL WITH LOGIN DATA>/"
Do Until IE.readyState = READYSTATE_COMPLETE
DoEvents
Loop
Set Doc = IE.document
Set Cible = Doc.Links(19)
Cible.Click
Bookmarks