Jump to content

Recommended Posts

Posted (edited)

That's good, I will learn something from it myself, but there are still only 25 results printed when there are 39 found.

EDIT:

Actually, for me, no results are returned on the first run, then on second run, sometimes 25, and sometimes 39 are printed.

EDIT2:

The only time I can get consistent results on first run is by adding a sleep after the first loop.

Local $oElems = _IETagNameGetCollection($oIE, "select") ; get all select tags
For $oElem In $oElems
    If StringInStr($oElem.className, 'resultsPerPage') Then ; this is the results-per-page select box
        _IEFormElementOptionSelect($oElem, 100) ; set it to 100 results per page
        ExitLoop ; exit the loop, there are more 'resultsPerPage' selects, no need to set it twice
    EndIf
Next
Sleep(1000)

EDIT3:

Forget the Sleep

A well placed loop (as suggested in Robjongs comments) works every time now.

Local $oElem ;declare this var now instead of redeclaring them in a loop
Local $iResultCount ;and this
Local $oTable = _IETableGetCollection($oIE, 4) ; get the results table (5th form, zero based so it becomes index 4)
; loop this part of code until the result count is not "0"
Do
Sleep(10)
$oElem = _IETagNameGetCollection($oTable, "td", 0) ; get the first td tag, contains a string with the result count
$iResultCount = Int(StringRegExpReplace($oElem.innerText, "D+", "")) ; strip every non digit, now we have the result count
Until $iResultCount <> 0

Also probably a good Idea to add

_IEQuit($oIE)

At end of code so you don't have stray hidden windows lurking.

Edited by JohnOne

AutoIt Absolute Beginners    Require a serial    Pause Script    Video Tutorials by Morthawt   ipify 

Monkey's are, like, natures humans.

Posted

Oh wow! Thanks Robjong! That was over the top! Just got a chance to check in. Busy day at work so far! Will read through to learn a bit, really really appreciate you taking it that far. I should be able to parse the data from there!

Posted

Wow! thanks a lot guys. I am done! The switch allowed me to resort it before writing, and the bit from JohnOne allowed me to verify it is loaded before proceeding! Crazy nice work! Thanks again!

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
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...