Klexen Posted July 7, 2007 Posted July 7, 2007 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")
PsaltyDS Posted July 7, 2007 Posted July 7, 2007 (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! Edited July 7, 2007 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
Klexen Posted July 7, 2007 Author Posted July 7, 2007 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! That still doesn't work for me. Could it have anything to do with Vista IE7 ?
PsaltyDS Posted July 7, 2007 Posted July 7, 2007 That still doesn't work for me. Could it have anything to do with Vista IE7 ?Wouldn't know, as I have yet to be forced (against my will, kicking and screaming) to use them. 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
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now