Iterations, variables, and my lack of programming skills

Hi all,

Firstly, thanks for reading. Just looking through over the last couple of weeks it seems like a really well 'cared for' forum.

My problem is that my programming background isn't good enough to put the logic into practice. Essentially I'm trying to extract horse racing information where each meeting has multiple races, and each race has multiple runners.

To illustrate what I'm trying to do, I've put it into a code box as follows:

Get month / state variables from CSV file

Enter and scrape monthly search page
Extract variables for state and meeting
---Use meeting / state variable to open race meeting page
------Get race information
------Write race information to session variables
---------Get horse information
------------Append race information to horse information
---------------Output record
---------Loop until no further horse information
------Loop until no further races
---Loop until no further race meetings on monthly search
Get next month / state variables from CSV file

So where have I got to:

* CSV file input and looping is fine
* Extracting all variables for the most part is fine - could probably do with a bit of a fix up but workable at this point
* Can output records OK
* The problem - being able to get a line with the (repeated) generic race information output with each horse's race information.

What I'm hoping for ... essentially to get someone to get the code in order to deliver this outcome. I was thinking eLance, but figured it would be better to start here! Currently using the basic version. Also, I have access to Citrix GoToMeeting, and was thinking that may be the easiest way to do it without starting from sratch?? That said, I'm based in Australia so there may be a couple of time issues (but none insurmountable).

Any thoughts, suggestions or proposals?! Thanks in advance,

jacko

You should have some

You should have some programming skill to be successful with screen-scraper. As it happens, in our script repository (http://community.screen-scraper.com/script_repository) there is a script to do a lot of what you noted. If you can follow that, you should be okay.

Thanks, but...

OK, thanks. Obviously I have used some of those scripts and modified them already (eg to read the CSV file in), but the iteration one I've tried but obviously stuffing something up. Is there anyone out there who has a 'live' version of the script? Alternately I'll shrug the shoulders, smile and chase up an alternative! One way or other I'll get there - this is just the preferred way because it's repeatable.

Thanks,
Jacko

It sounds like you need some

It sounds like you need some loops nested together. I have a loop we use for a form that requires us to put in at least 3 letters of a name into a form, and we just submit it with all 3 letter combinations.

// Create an array containing the alphabet.
String[] alphabet = { "A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R", "S", "T", "U", "V", "W", "X", "Y", "Z" };
session.log("+++Looping 3 tiers of " + alphabet.length + " letters");

// Basic for loop to get started.
for (i=0; i {
session.log("+++Starting: " + alphabet[i]);
for (j=0; j {
session.log("+++Starting : " + alphabet[i] + alphabet[j]);
for (k=0; k {
searchName = alphabet[i] + alphabet[j] + alphabet[k];
session.log("***Submitting: " + searchName);
session.setVariable("SEARCH_NAME", searchName);
session.scrapeFile("Search results");
}
}
}

Good luck.

Thanks, but ...

I don't think that's what I'm searching for. I do, however, appreciate the effort / response.

Perhaps more constructively I've just re-read my original post and noticed that I neglected to say that I'm happy to pay for someone's expertise. I did mention online meeting facilities and vaguely solicited 'proposals', but looking over it again it doesn't really explain this! Probably lacking sleep at that point. In any event, if anyone - including the based in Utah - is available, just let me know via this or email (removed ... ok, I assume this isn't going to get anywhere). Off to eLance!)

Thanks in advance.