Skip to main content
Cadet | Tier 2
October 7, 2022
Question

How to automate Weblinks click one by one

  • October 7, 2022
  • 9 replies
  • 492 views

Hi All,

 

I have a scenario, I have open one by one link from one site and get the tables items to excel. After 1st click, its not going to the next link.

 

Can someone suggest what is the solution for this:

 

imageBelow loop is not working as shown below:image

    9 replies

    Navigator | Tier 3
    October 12, 2022

    Hi @Ranjit Nayak​ 

     

    I would use destination url to directly navigate to each currency based on a list of the currency code.

     

    Example

    https://www.x-rates.com/table/?from=b>ARS

    https://www.x-rates.com/table/?from=b>BRL

    ... etc

     

    Paul Hawkins
    Navigator | Tier 3
    October 12, 2022

    It's not clear how you are doing the first part.

     

    Assuming you're getting a count of items in the UL and then looping x times with a dynamic xpath?

     

    Something like:

    //*[@id="content"]/div[3]/div/div/div/ul/li[$Counter$]/a[1]

     

    Is it getting back to the home screen after clicking the initial link? If there is an issue using the back function, I noticed there is a 'home' link on the clicked page, which will navigate you back

    Cadet | Tier 2
    October 13, 2022

    Yes Thanks, I did the same approach, It did work. I also used navigate back option which clicks the next link after some activity. All fine now.

     

    One more challenge in this: After each link click, there are multiple tables for each page in the link, need to extract to a excel and there is no get items options to count. Any approach, how to get to table data inside loop and store in excel?

     

    Thanks!

    Paul Hawkins
    Navigator | Tier 3
    October 13, 2022

    @Ranjit Nayak​ The tables appear within the same root element it seems e.g.

     

    //*[@id="content"]/div[1]/div/div[1]/div[1]/table[1]

    //*[@id="content"]/div[1]/div/div[1]/div[1]/table[2]

     

    If the number of tables is not static, you could use an additional loop to loop over the tables, and check the element exists before extracting the table data

     

    Cadet | Tier 2
    October 13, 2022

    Can you please help me which is wrong in this looping. Its only taking 2nd table from datatable. Its not taking 1st datatable data.

     

    Thanks!

    image

    Paul Hawkins
    Navigator | Tier 3
    October 14, 2022

    You appear to be creating your counter after fetching the table details, if you modify the path of the table you'll need the counter to make it dynamic

    Cadet | Tier 2
    November 9, 2022

    Hi Paul,

     

    Just a question on this assignment i have. I have static table of 2 on each page load, How do i merge both table data into one. what steps need to take to get both the table data?

    Paul Hawkins
    Navigator | Tier 3
    November 9, 2022

    @Ranjit Nayak​ If they are already stored in separate data tables, you can use the Merge action on the data table package

     

    https://docs.automationanywhere.com/bundle/enterprise-v2019/page/enterprise-cloud/topics/aae-client/bot-creator/commands/cloud-data-table-command.html

     

    If its saved elsewhere like Excel, you can use the database package to query the sheets and use a SQL UNION query to combine them

    Cadet | Tier 2
    November 9, 2022

    The usecase is, i need to navigate each link on a page, each link has 2 tables, need to extract values and store in one excel separate sheets for each link.