Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
The form name changes everytime we open the page
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<bSort</b</td</tr<tr valign=top <td nowrap <input type=radio name=F5 value="0" checkedBy 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<bPeriod</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" checkedLast 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 -- shart ------------------------------------------------------------------------ shart's Profile: http://www.excelforum.com/member.php...o&userid=29563 View this thread: http://www.excelforum.com/showthread...hreadid=499289 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
The form name changes everytime we open the page
could we use VBA to select the 1st radio option in set one and the 3rd in set 2? thank you. Simon -- shart ------------------------------------------------------------------------ shart's Profile: http://www.excelforum.com/member.php...o&userid=29563 View this thread: http://www.excelforum.com/showthread...hreadid=499289 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Open at same sheet everytime | Excel Discussion (Misc queries) | |||
Using a template form, advance a form number everytime you open | Excel Discussion (Misc queries) | |||
How do I set up an excel doc. to open on the same tab everytime | Excel Discussion (Misc queries) | |||
how can I make a form number change everytime the form is opened | Excel Worksheet Functions |