Welcome to openkapow Sign in | Join
in Search
.

loop count / global variables won´t work

Last post 06-24-2008, 7:08 AM by pwedgbury. 4 replies.
Sort Posts: Previous Next
  •  06-24-2008, 4:12 AM 20114

    loop count / global variables won´t work

    Hi,

     I´ve been working on a robot that loops through search results and extracts data from detail pages. due to the design of the target website, the robot has to go through several pages of search results. The robot and extraction work fine, but I can´t figure out how to use global variables to stop the robot, e.g. after the first three pages of search results.

    the robot looks like this so far:

     navigation - create variable - repeat - get global variable - test attributes -  for each tag - extraction - return object

                                                                                                  \ click next link - increase variable - next

     the robot works fine, i get loads of extracted data - but the value of the variable won´t change, in the debugger´s output view the output attribute, which the variable´s value should be written to, remains empty, only the attribute´s name is being displayed.

     since I couldn´t figure out how to get the solution with the global variables working, i tried a workaround, using the "assign attributes"-action instead of the global variables, unfortunately without succes.

    I am grantful for any suggestions :D

    Bye,

     Phil

  •  06-24-2008, 5:32 AM 20118 in reply to 20114

    Re: loop count / global variables won´t work

    Hi Phil

    I think you have to assign a value to the global variable before you can use "increase global variable".

    Another way to do this is to use Get Iteration to get the page number, and then Test Attribute to terminate the robot when the desired page is reached..

    -Simon

  •  06-24-2008, 6:41 AM 20126 in reply to 20118

    Re: loop count / global variables won´t work

    Hi Simon,

     thank you for the quick response!

    Unfortunately, although I have assigned a value to the global variable, it just refuses to work :D i try to test the value with an "test attributes"-action, but it seems that there are no changes to the value, although the global variable´s value is changing. Looks like the problem is that action, my output attribute 3 value, which the variable should be assigned to, remains empty.

     i have published (a less detailed version of) this robot here: http://openkapow.com/files/folders/tutorials_and_examples/entry20125.aspx

     

    since I´m no experienced openkapow user (startet a few days ago), it might be that i made an error in my reasoning, eg maybe the return response action might be in the wrong branch. 

    anyway, thank you for your help!

     kind regards,

    phil

  •  06-24-2008, 6:59 AM 20127 in reply to 20126

    Re: loop count / global variables won´t work

    Get global var step should be BEFORE the TEST arttr. step !

    Otherwise value3 will be empty.

    Btw. You can't run this robot on Openkapow because openkapow.com is blocked by google.

     

     

  •  06-24-2008, 7:08 AM 20128 in reply to 20127

    Re: loop count / global variables won´t work

    thanks, mrx, that did it!

    best wishes,

     Phil

View as RSS news feed in XML
.
Copyright 2006, 2007 KapowTech.com All Rights Reserved Company | Contact | Terms | Privacy