Jump to content

Holy cow this is tough...


Recommended Posts

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
Link to comment
Share on other sites

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!

Link to comment
Share on other sites

  • Developers

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

than don't ... its not that long ago since you posted

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
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
 Share

  • Recently Browsing   0 members

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