I would like to know how to separate these no.s (1-60 of 68)

Hints, tips and tricks for newbies

Moderators: Dorian (MJT support), JRL

Post Reply
Alpha_AI
Pro Scripter
Posts: 61
Joined: Wed Sep 19, 2007 9:30 am

I would like to know how to separate these no.s (1-60 of 68)

Post by Alpha_AI » Tue Nov 13, 2007 3:58 pm

Hi,

There is this website that i am trying to retrieve info from
and the problem i have is finding out how many times i need to loop to get each link on the page.

The maximum links that can be on per page is 60
but as you can see the last page has only 8 links on it. In total there are two pages.

These numbers change of course depending on the search criteria.
Whats the best method and simplest method of retrieving these numbers?

The 60 would obviously mean the amount of times i need to loop through
but then somehow i would need it to loop through only 8 times on page 2.

MidStr only returns a substring based on length and starting position.
Anyone has any ideas on how i can separate those numbers?

Ben



Ben

Alpha_AI
Pro Scripter
Posts: 61
Joined: Wed Sep 19, 2007 9:30 am

Post by Alpha_AI » Tue Nov 13, 2007 4:31 pm

I didnt realised that pos would also return a substring.

so here we go, this code works.
//Returns 60
Pos>-,(1-60 of 68),1,StartPos
Add>StartPos,1
Pos> of,(1-60 of 68),1,EndPos
Let>NewValue=EndPos-StartPos
MidStr>(1-60 of 68),StartPos,NewValue,Ben
MessageModal>%Ben%

//Returns 68
Pos>of ,(1-60 of 68),1,StartPos
Add>StartPos,3
Pos>),(1-60 of 68),1,EndPos
Let>NewValue=EndPos-StartPos
MidStr>(1-60 of 68),StartPos,NewValue,Ben
MessageModal>%Ben%

Thanks anyway. I think this is the best method for now.

Ben


----Edited by moderator, disabling Smilies to remove smiley faces for the number 68.

Post Reply
cron
Sign up to our newsletter for free automation tips, tricks & discounts