Jump to content
Sign in to follow this  
tantojan

not sure how to get autoit to scroll through results pages

Recommended Posts

tantojan

Hi, I'm having trouble figuring this out...I've worked my way this far with not much understanding of html but I'm at an impasse. I'm trying to automate through a web page, you enter in search criteria and you're given up to 10 pages of results. The problem is, I can't find any form or elements to try and control to get to the next page of results (it's a 1 2 3 4 5 etc type deal). I think the 1 2 3 4 etc may be part of something called a span or div but I can't figure out what that means or how auto it would let me control it...

ANY HELP IS APPRECIATED!!!

Thanks

#include <IE.au3>

$oIE = _IECreate ("https://directory.soa.org/solutionsite/default.aspx?tabid=123")

$o_form = _IEFormGetObjByName ($oIE, "form")

$o_lastname = _IEFormElementGetObjByName ($o_form, "_ctl0__ctl0__ctl0_txtLAST_NAME")

$o_state = _IEFormElementGetObjByName ($o_form, "_ctl0__ctl0__ctl0_drpStateCode_txtState")

$o_submit = _IEFormElementGetObjByName ($o_form, "_ctl0__ctl0__ctl0_btnSearch")

_IEFormElementSetValue ($o_lastname, "s")

_IEFormElementSetValue ($o_state, "tx")

_IEAction ($o_submit, "click")

Share this post


Link to post
Share on other sites
tantojan

actually, here is the link on the menu I'm trying to scroll through:

java script:__doPostBack('_ctl0$_ctl0$_ctl0$dgSearchResult$_ctl14$_ctl2','')

How to I activate this through autoscript?

Share this post


Link to post
Share on other sites
tantojan

nevermind, I figured it out, you can do an ienavigate with the javascript command

Share this post


Link to post
Share on other sites
sfblue

nevermind, I figured it out, you can do an ienavigate with the javascript command

Tantojan, could you give some example code for this? I looked up IENavigate and it seemed to want a URL, does that apply in this case?

The code I am trying to automate is also to scroll through pages, and the javascript is:

<a class="pagingLink" href="java script:__doPostBack('ctl00$cpMain$pagerTop','2')">Next &rsaquo;</a>

Share this post


Link to post
Share on other sites
DaleHohm

You should just be able to do _IELinkClickByText($oIE, "7") to click on the 7th page.

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

Share this post


Link to post
Share on other sites
tantojan

Tantojan, could you give some example code for this? I looked up IENavigate and it seemed to want a URL, does that apply in this case?

The code I am trying to automate is also to scroll through pages, and the javascript is:

<a class="pagingLink" href="java script:__doPostBack('ctl00$cpMain$pagerTop','2')">Next &rsaquo;</a>

Sure, here's what I did:

_Ienavigate($oIE,"java script:__doPostBack('_ctl0$_ctl0$_ctl0$dgSearchResult$_ctl14$_ctl2,')")

Just look at the links for the scroll numbers and see how they change (in my case the ctl2 would change to ctl3 , ctl4 etc. Then use the ienavigate command with the entire javascript command ( java script:_dopostback etc. ) as the URL to navigate to.

Good luck!

Share this post


Link to post
Share on other sites
sfblue

Many thanks, I will try this!

You should just be able to do _IELinkClickByText($oIE, "7") to click on the 7th page.

Dale

Share this post


Link to post
Share on other sites
sfblue

Sure, here's what I did:

_Ienavigate($oIE,"java script:__doPostBack('_ctl0$_ctl0$_ctl0$dgSearchResult$_ctl14$_ctl2,')")

Just look at the links for the scroll numbers and see how they change (in my case the ctl2 would change to ctl3 , ctl4 etc. Then use the ienavigate command with the entire javascript command ( java script:_dopostback etc. ) as the URL to navigate to.

Good luck!

Many thanks, I will try this also! I really appreciate the help guys!

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  

×