The form name changes everytime we open the page

S

shart

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:

Code:
--------------------
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:

Code:
--------------------

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

--------------------




<form method=post onsubmit="" action=http://{insert
url}/55b17784fc5f/CwfXnAA6/WABu name=fF2>
<input type=hidden name=FORM_TOP value=FORM_TOP>
<input type=submit name=F4 value="Show">
<table border=2 cellspacing=0 cellpadding=10><tr valign=top>
<td nowrap><table border=0 cellpadding=2 cellspacing=0>
<tr valign=bottom><td nowrap colspan=1><b>Sort</b></td></tr><tr
valign=top>
<td nowrap>
<input type=radio name=F5 value="0" checked>By Count of Items Sold
<br>
<input type=radio name=F5 value="1">By Count of Orders <br>
<input type=radio name=F5 value="2">By Revenue
</td>
</tr></table><td>
<td nowrap><table border=0 cellpadding=2 cellspacing=0>
<tr valign=bottom><td nowrap colspan=3><b>Period</b></td></tr><tr
valign=top>
<td nowrap>
<input type=radio name=F6 value="0">Last 10 Days <br>
<input type=radio name=F6 value="1">Last 30 Days <br>
<input type=radio name=F6 value="2">Last 60 Days <br>
<input type=radio name=F6 value="3">Last 90 Days
</td>
<td nowrap>
<input type=radio name=F6 value="4">Last 120 Days <br>
<input type=radio name=F6 value="5">Last 180 Days <br>
<input type=radio name=F6 value="6" checked>Last 365 Days <br>
<input type=radio name=F6 value="7">August 2005
</td>
<td nowrap>
<input type=radio name=F6 value="8">September 2005 <br>
<input type=radio name=F6 value="9">October 2005 <br>
<input type=radio name=F6 value="10">November 2005 <br>
<input type=radio name=F6 value="11">December 2005
</td>
</tr></table><td></td></tr></table>
<input type=hidden name=FORM_BOT value=FORM_BOT></form>
 
S

shart

could we use VBA to select the 1st radio option in set one and the 3rd
in set 2?

thank you.
Simon
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top