Jump to content

Recommended Posts

Posted (edited)

So basically, my dilemna is this:

Once I am on a webpage, I am presented with 20 links.

These links are basically all the same, but with three differences.

The format of the links are as such:

http://www.site.com/blah=A&blah=B&blah=C

What I want to do, is take _IELinkGetCollection to get all of the links,

then I want to do something with the .href function and _StringBetween

in order to do two things:

For each link in the collection (starting with the first)

1. Find out if B is equal to a certain number (say 24)

if not, move on to the next link in collection

2. Find out if C is less than or equal to a certain number (say 100)

if not, Func()

if true, return indexed value (like 3 if it is the 3rd link on the page)

I am not asking for anyone to do this for me, but I desperately need help with the bolded parts.

Any help AT ALL (seriously, anything, even if it is only a word) will be much appreciated!

Edited by multiloser
Posted

I hate to bump this thread, but this is quite a wall for me...

I'm looking for something where it would be like...

For $Link in $Links

If _StringBetween ($Link, "Blah", "Blah")

And then I get lost, and I'm not sure if that up there is correct ^ the if statement, if there is a better way...

AHH I JUST DONT KNOW!

Posted

Here you go. Loop the checkForNumber function for all lines you want to check...

$linkstring = "http://www.site.com/blah=11&blah=111&blah=1111"
$num2check4 = 111
If checkForNumber($linkstring, $num2check4) Then MsgBox(0, "test", "Found number!")
Exit

Func checkForNumber($linkstring, $num2check4)
    While StringLen($linkstring) > 0 ; number("111&blah=1111") returns 111, for instance
        If (Number($linkstring) = $num2check4) Then Return True ; number found
        $linkstring = StringTrimLeft($linkstring, StringLen(String(Number($linkstring)))) ; strip amount of digits in numeric representation of remaining $linkstring; this means 1 for non-numeric repr.
    WEnd
    Return False ; number was not found
EndFunc   ;==>checkForNumber

Roses are FF0000, violets are 0000FF... All my base are belong to you.

Posted

And to get the hrefs (pretty much the example from the helpfile):

$oLinks = _IELinkGetCollection($oIE)
For $oLink In $oLinks
    $sHref = $oLink.href
    ; then work with something like the example from sadbunny
Next

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

Posted

  Saunders said:

A word.

I hope his 'only a word' criterium is stretchable to your two word answer...

Roses are FF0000, violets are 0000FF... All my base are belong to you.

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...