danpaul23 Posted January 13, 2007 Share Posted January 13, 2007 I'm trying to run the script below. Basically, it looks at the price of the first book and if it is less than $5 it opens up the page for product information for that book. I will have it do some things on that page eventually but now, I'm just trying to get it to go to that page then come back to look at the next item on the page. It goes and comes back but after it has returned, it gives an error message instead of going to the next book on the page. Thanks again. CODE; Script Start - Add your code below here #include <IE.au3> $sURL = "http://www.amazon.com/s/ref=nb_ss_b/102-5993488-0177751?url=search-alias%3Dstripbooks&field-keywords=mystery&Go.x=0&Go.y=0&Go=Go" $tryAttach = True $oIE = _IECreate($sURL, $tryAttach) $oTables = _IETableGetCollection($oIE) For $oTable in $oTables If String($oTable.className) = "searchresults" Then $oTDs = _IETagnameGetCollection($oTable, "td") For $oTD in $oTDs If String($oTD.className) = "searchitem" Then $oSpans = _IETagNameGetCollection($oTD, "span") For $oSpan in $oSpans Switch String($oSpan.className) Case "srTitle" $oVar4 = $oSpan.innerText Case "otherprice" $oVar5 = $oSpan.innerText $oVar6 = Number(StringTrimLeft($oVar5, 1)) If $oVar6 < 5 Then _IELinkClickByText ($oIE, $oVar4) MsgBox(0, "", "") _IEAction ($oIE, "back") _IELoadWait ($oIE) EndIf EndSwitch Next EndIf Next EndIf Next Link to comment Share on other sites More sharing options...
BALA Posted January 13, 2007 Share Posted January 13, 2007 What was the error? [font="Comic Sans MS"]BA-LA[/font]http://ba-la.110mb.comJoin my community, CLICK HEREAlternative links to my site:http://www.ba-la.tkhttp://www.ba-la.co.nrContact me if you would like to help with some of my projects: joeythepirate@gmail.com Link to comment Share on other sites More sharing options...
danpaul23 Posted January 13, 2007 Author Share Posted January 13, 2007 What was the error?The error is on the Switch String lineIt says:Switch String($0Span.className)Switch ^ERRORError: The requested action with this object has failed. Link to comment Share on other sites More sharing options...
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