Jump to content
Sign in to follow this  
laffo16

Differculties parsing a Form from HTML URL. help!

Recommended Posts

laffo16

Ok, i'd appreciate any help at all with this one. it not really an autoit problem specificaly, but heres my problem.

on the following page, theirs a drop down box with "Race 1: 1000m", their are 8 other races in this box. the URL below sends to Race 1 as default.

http://www.thetote.com.au/racing/results/r...meetingID=48314

now the source for this drop down reads:

CODE
<div id="eventData">

<select name="eventID" value="" id="events" class="events" onchange="racecard.handleChangeTo(this);"><option value="426752" class="closed">Race 1: 1000m</option><option value="426753" class="closed">Race 2: 1400m</option><option value="426754" class="closed" selected="true">Race 3: 1200m</option><option value="426755" class="closed">Race 4: 1400m</option><option value="426756" class="closed">Race 5: 2500m</option><option value="426757" class="closed">Race 6: 1200m</option><option value="426758" class="closed">Race 7: 2000m</option><option value="426759" class="closed">Race 8: 1600m</option></select>

</div>

i also downloaded the webpage and ran a search for "handleChangeTo" and found

CODE
function Racecard() {

var postBack = function() {

document.forms["frmSelectEvent"].submit();

}

this.change_meeting = function(a, b, c) {

var _meeting = a.options[a.selectedIndex].text;

if (_meeting.indexOf("Sweden V75") >= 0) {

var action = document.location.href;

action = "V75" + action.substring(action.indexOf("results.aspx"))

+ "&meetingId=" + a.value;

document.getElementById("frmSelectEvent").action = action;

}

postBack();

}

this.handleChangeTo = function(a) {postBack();}

}

var racecard = new Racecard();

my objective is to find a way of downloading the source for the other races, but so far im rattled how it can be done. ive tried numerus URLs but not found the correct link yet, pls someone tell me it is possible. thanks for any help.

Edited by laffo16

Share this post


Link to post
Share on other sites
laffo16

figured out i can control the drop with these functions, it submits automaticly

;$oIE = _IECreate ("http://www.thetote.com.au/racing/results/results.aspx?Date=01%20Jan%202008&meetingID=48314")
$oIE = _IEAttach ("Racing Results Online")
$oForm = _IEFormGetObjByName ($oIE, "frmSelectEvent")
$oText = _IEFormElementGetObjByName ($oForm, "eventID")
_IEFormElementSetValue ($oText, "426759")

i was hoping to handle the data gathering just from _INetGetSource() but i cant figure out the JS and if it is possible to access say Race 2 directly.

Share this post


Link to post
Share on other sites
laffo16

well, a friend of a friend on msn is looking into it,

.:: | Mr. Chris | ::. > the only way to get a specific url is connect the the web page using a console like telnet and sending the post information directly

.:: | Mr. Chris | ::. > or create a dumby page, that downloads the page, and then creates a new javascript that automatically posts with the specified race number

.:: | Mr. Chris | ::. > i could theoretically do that

.:: | Mr. Chris | ::. > gimme 30 minutes to see what i can come up with

laffo16 | > ok tell him telnets over my head, but i have a way of controling IE forms and submitting them automaticly, so for the moment this is the only way i can access each races source

Share this post


Link to post
Share on other sites
DaleHohm

You may want to look at _IEFormElementOptionselect

what to you mean by "access each races source"?

Dale


Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curl

MSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object model

Automate input type=file (Related)

Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?

IE.au3 issues with Vista - Workarounds

SciTe Debug mode - it's magic: #AutoIt3Wrapper_run_debug_mode=Y Doesn't work needs to be ripped out of the troubleshooting lexicon. It means that what you tried did not produce the results you expected. It begs the questions 1) what did you try?, 2) what did you expect? and 3) what happened instead?

Reproducer: a small (the smallest?) piece of stand-alone code that demonstrates your trouble

Share this post


Link to post
Share on other sites
laffo16

You may want to look at _IEFormElementOptionselect

what to you mean by "access each races source"?

Dale

as in _inetgetsource() for each race. but the URL doesnt change when you select ie Race: 2 from the drop down.

thanks for the suggestion, and i will be dropping back on _IE object control if i cant find a solution to getting race2 page source directly with _inetgetsource.

i would also be intrested if its possible to disable images from loading in a specific browser instance, if i have no choice but to display and navigate through the browser then having all downloads apart from source disabled would be handy.

Edited by laffo16

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×