Jump to content

Recommended Posts

Posted

Say I search for "Sopranos" shouldn't it click the link with that text? It doesn't recognize it. I have tried a lot of IE examples with this page and nothing is working..

#include <IE.au3>

$URL = InputBox("Search","What would you like to search for?")

$sURL = "http://www.newzbin.com/search/query/p/?q=" & $URL & "&Category=-1&searchFP=p"
$oIE = _IECreate($sURL, 0, 0, 0)
$HWND = _IEPropertyGet($oIE, "hwnd")
    WinSetState($HWND, "", @SW_MAXIMIZE)
    _IEAction($oIE, "visible")
    _IELoadWait($oIE)

_IELinkClickByText ($oIE, "The Sopranos - 2x04 - Commendatori")
Posted (edited)

This code lists the links on the page (and is much less annoying to run than yours due to the maximize and no attach options):

#include <IE.au3>
$oIE = _IECreate("http://www.newzbin.com/search/query/p/?q=Sopranos&Category=-1&searchFP=p", 1)
$colLinks = _IELinkGetCollection($oIE)
$iLinks = @extended
If $iLinks Then
    $i = 0
    ConsoleWrite("Links found: " & $iLinks)
    For $oLink In $colLinks
        $sOuterText = $oLink.outerText  & ""
        ConsoleWrite($sOuterText & @LF)
        If StringInStr($sOuterText, "The Sopranos - 2x04 - Commendatori") Then
            ConsoleWrite("Match found: " & $i & @LF)
            _IELinkClickByIndex($oIE, $i)
        EndIf
        $i += 1
    Next
Else
    ConsoleWrite("No links found." & @LF)
EndIfoÝ÷ ØGb´Z.Ø­{ax»uÊ.­Ç¢·lªê-¢ë^®×±¶«¨µ8^~éçÊØb¬!ú.Ø­{ayû§rبú+ Bâ@¥ÉÉ7±·brhzÉ÷öÜ(®Gè®gØ^¬¬yÒ.)ä
X×±iº/y©ÝÜ(®KéÈr¦z{m«hºÖ§vëÓ~¨.)ärX©ÝÖÒLËý¼(®KºÚ"µÍÈÒQS[ÐÛXÚÐR[^
    ÌÍÛÒQK  ÌÍÚJB    ÌÍÛÓ[ËÛXÚ

...which is odd because that's exactly how _IELinkClickByText() works. The only functional difference I see is that my code uses StringInStr(), while the UDF does a straigt '=' compare.

But it works, so click on!

:whistle:

Edited by PsaltyDS
Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law
Posted

This code lists the links on the page (and is much less annoying to run than yours due to the maximize and no attach options):

#include <IE.au3>
$oIE = _IECreate("http://www.newzbin.com/search/query/p/?q=Sopranos&Category=-1&searchFP=p", 1)
$colLinks = _IELinkGetCollection($oIE)
$iLinks = @extended
If $iLinks Then
    $i = 0
    ConsoleWrite("Links found: " & $iLinks)
    For $oLink In $colLinks
        $sOuterText = $oLink.outerText  & ""
        ConsoleWrite($sOuterText & @LF)
        If StringInStr($sOuterText, "The Sopranos - 2x04 - Commendatori") Then
            ConsoleWrite("Match found: " & $i & @LF)
            _IELinkClickByIndex($oIE, $i)
        EndIf
        $i += 1
    Next
Else
    ConsoleWrite("No links found." & @LF)
EndIfoÝ÷ ØGb´Z.Ø­{ax»uÊ.­Ç¢·lªê-¢ë^®×±¶«¨µ8^~éçÊØb¬!ú.Ø­{ayû§rبú+ Bâ@¥ÉÉ7±·brhzÉ÷öÜ(®Gè®gØ^¬¬yÒ.)ä
X×±iº/y©ÝÜ(®KéÈr¦z{m«hºÖ§vëÓ~¨.)ärX©ÝÖÒLËý¼(®KºÚ"µÍÈÒQS[ÐÛXÚÐR[^
    ÌÍÛÒQK  ÌÍÚJB    ÌÍÛÓ[ËÛXÚ

...which is odd because that's exactly how _IELinkClickByText() works. The only functional difference I see is that my code uses StringInStr(), while the UDF does a straigt '=' compare.

But it works, so click on!

:whistle:

That still doesn't work for me. Could it have anything to do with Vista IE7 ?

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