Sign in to follow this  
Followers 0
Steve1040

navigate to next page in search results

5 posts in this topic




Here is a sample script I just got called away from my desk so I haven't tested it yet but the concept should work. Basically go to the place you want this script to click and press ctrl s from than on out anytime you press ctrl n it will click on that spot. Escape ends the program or you could go to the bottom right corner and click exit. If it were me I would only have it work in certain windows so you might want to slap a window specific if statment on it. It also just occured to me ctrls is a stupid key to use so you might want to switch it so it doesn't adversly effect your saving.

Global $Paused
HotKeySet("^n", "FunNext") ;ctrl+n goes to next page
HotKeySet("^s", "FunSet") ;ctrl+s sets location, click ctrl s on the location you want to click the 1st time
HotKeySet("{ESC}", "Terminate")

Dim $location

While 1
    Sleep(100)
WEnd
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func FunSet()

$location=mousegetpos()

EndFunc
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func FunNext()

mouseclick("left",$location[0],$location[1],1,0)

EndFunc
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Func Terminate()
    Exit 0
EndFunc


            
        

        
            
                

    
        
            
        
    


            
        

        
            
                
                
                
            
            
                
            
        
        
    

    
        
            Share this post
            
Link to post
            
            
            

            
                Share on other sites
                

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    

            
        
    


    

                    
                
                    
                    
                    






    
    
        
GMK   

    
        
    
             23
    
        
    

        
            
                 
            
            

            
                

    
        
    

            
            Active Members
            
            
                

    
        
    
             23
    
        
    

                401 posts
                
                

            
        
    
    
        


    

    
        
            
            
                
            
            
        

        
    #3 · 
            Posted 
            
            
            
        
    

    


            
        
            This is example onlyOK if I go to this url:http://www.americanclassifieds.com/browse....uesttimeout=300Results are on multiple pagesWhich AutoIt function would allow me to do this?ThanksSteveWhich AutoIt function would allow you to do what?  If you're trying to navigate to the pages, look into the IE UDF help files.


            
        

        
            
                

    
        
            
        
    


            
        

        
            
                
                
                
            
            
                
            
        
        
    

    
        
            Share this post
            
Link to post
            
            
            

            
                Share on other sites
                

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    

            
        
    


    

                    
                
                    
                    
                    






    
    
        
DaleHohm   

    
        
    
             58
    
        
    

        
            
                Think of IE as an API...
            
            

            
                

    
        
    

            
            MVPs
            
                
            
            
                

    
        
    
             58
    
        
    

                5,930 posts
                
                

            
        
    
    
        


    

    
        
            
            
                
            
            
        

        
    #4 · 
            Posted 
            
            
            
        
    

    


            
        
            Easiest would be _IELinkClickByText

Dale


            
        

        
            
                

    
        
            
        
    


            
        

        
            
                
                
                
            
            
                
            
        
        
            




  
  
    Free Internet Tools: DebugBar, AutoIt IE Builder, HTTP UDF, MODIV2, IE Developer Toolbar, IEDocMon, Fiddler, HTML Validator, WGet, curlMSDN docs: InternetExplorer Object, Document Object, Overviews and Tutorials, DHTML Objects, DHTML Events, WinHttpRequest, XmlHttpRequest, Cross-Frame Scripting, Office object modelAutomate input type=file (Related)Alternative to _IECreateEmbedded? better: _IECreatePseudoEmbedded  Better Better?IE.au3 issues with Vista - WorkaroundsSciTe 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
  


        
    

    
        
            Share this post
            
Link to post
            
            
            

            
                Share on other sites
                

    
        
            

    

        
            

    

        
            

    

        
            

    

        
    

            
        
    


    

                    
                
                    
                    
                    






    
    
        
SmOke_N   

    
        
    
             198
    
        
    

        
            
                It's not what you know ... It's what you can prove!
            
            

            
                

    
        
    

            
            Moderators
            
                
            
            
                

    
        
    
             198
    
        
    

                16,152 posts
                
                

            
        
    
    
        


    

    
        
            
            
                
            
            
        

        
    #5 · 
            Posted 
            
            
            
        
    

    


            
        
            I don't have time to debug why (on my system (seems to be having issues at the moment with a lot of things... ie msgbox's being surpressed)) _IEBodyReadHTML is failing (might be frames, I don't know)... but I replaced it with _InetGetSource() so you would have an idea....

#include <ie.au3>
#include <inet.au3>
Global $sURL, $oIE, $aTotalPages, $nTPages, $iCC, $sURLText
$sURL = "http://www.americanclassifieds.com/browse.cfm?classID=18&paper=53&requesttimeout=300"
$sURLText = _INetGetSource($sURL)
$oIE = _IECreate($sURL)
$aTotalPages = StringRegExp($sURLText, "(?s)(?i)Miscellaneous&searchTotal=(\d+)\&", 1)
If IsArray($aTotalPages) = 0 Then
    MsgBox(16, 'Error', 'Seems to only be this page')
    Exit
EndIf
$nTPages = Int(Round((Int($aTotalPages[0])/10), 0)) ; 10 is how many show on each page
For $iCC = 2 To $nTPages
    If MsgBox(36, "Continue?", "Would you like to go to the next page?") = 7 Then ExitLoop
    _IENavigate($oIE, "http://www.americanclassifieds.com/browse.cfm?1=1&criteria=&classification" & _
        "=18&paper=53&searchPaperRegion=0&searchPapers=&searchTotal=207&%20Miscellaneous&startRow=" & $iCC & "1")
Next

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
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
Sign in to follow this  
Followers 0