KAPOW

Would you like to react to this message? Create an account in a few clicks or log in to continue.
KAPOW

Welcome to the Kapow forum. Here you can get help, use your skills to help others and enjoy hanging out in the company of other Kapow Robot Developers.


2 posters

    Looping a webpage in Device Automation

    avatar
    andobe


    Posts : 14
    Points : 1901
    Join date : 2019-03-22

    Looping a webpage in Device Automation Empty Looping a webpage in Device Automation

    Post by andobe Wed Apr 17, 2019 9:36 pm

    Hello everyone!

    I need to loop through several rows in a webpage and extract some date for each row. I can only loop through the Device Automation step. After i need somehow to write the data extracted to a Excel file, with each loop iteration.
    Can anybody advise how this can be done ? 

    Thanks!
    batman
    batman


    Posts : 47
    Points : 1923
    Join date : 2019-03-19

    Looping a webpage in Device Automation Empty Re: Looping a webpage in Device Automation

    Post by batman Thu Apr 18, 2019 12:15 am

    There's a few ways you could do this.

    Personally I would build/harvest a data structure inside the DA step that contains all your web data, return this variable from the DA action and then perform the Excel update in the main workflow design. This saves you jumping backwards and forwards as you perform each update and the good old Native Excel is so easy to work with  Smile

    For the data structure you could add the web content into a variable and structure it as JSON/XML to make it easy to parse on the other side, but there's probably an even easier way..

    DA also allows you to extract portions of the application tree as XML (just right click a given section of the application tree and select Extract Tree as XML). Doing this will probably give you all the content you need without having the build the data structure, although if you have multiple pages of content you'll need to cater for that by appending subsequent bits of the tree to your previous XML

    Extract from the documentation below shows how the tree can be extracted for a standard application - note you probably want to ignore derived attributes.

    Looping a webpage in Device Automation Extrac11

    Once you have this XML returned back to your main workflow you can loop through it and perform the Excel updates.

    OR
    If you're feeling really brave you could perform the whole process inside a single DA step using the native Excel interface inside DA
    OR
    Launch the Excel application on the desktop and make your updates there inside the DA step, but who would want to launch an application on a desktop when you have 2 native Excel interfaces built in  Wink
    avatar
    andobe


    Posts : 14
    Points : 1901
    Join date : 2019-03-22

    Looping a webpage in Device Automation Empty Re: Looping a webpage in Device Automation

    Post by andobe Thu Apr 18, 2019 12:59 pm

    Batman to the rescue Very Happy Thank you very much man,great stuff i will try it!

    Sponsored content


    Looping a webpage in Device Automation Empty Re: Looping a webpage in Device Automation

    Post by Sponsored content


      Current date/time is Sun Apr 28, 2024 10:06 am