cancel
Showing results for 
Search instead for 
Did you mean: 

Web Scraping multiply elements

Raphael_Sampaio
Level 2

I'm handling with a trouble that is:

i wanna scrap name and price of items from a website, but i don't know how to do it by multiple elements...

I know do it with Python, but not in Blue Prism.

Some one can help me please?

#webscraping #scrap

1 REPLY 1

Hi @Raphael_Sampaio.,

Extracting table data (such as item prices) from a website using Blue Prism can be a bit tricky, but it’s definitely doable by following these steps carefully:

Steps to Scrape Table Data in Blue Prism:

  1. Spy the first cell of the table. Example (screenshot below):saha1sourav2_1-1749983411245.png

     

    Let's assume the HTML path for the first cell is: /HTML[1]/BODY[1]/DIV[5]/DIV[1]/TABLE[1]/TBODY[1]/TR[1]/TD[2]
  2. Spy the second cell (same column, next row):
  3. saha1sourav2_2-1749983562627.png

    Assumed HTML path: /HTML[1]/BODY[1]/DIV[5]/DIV[1]/TABLE[1]/TBODY[1]/TR[2]/TD[2]

  4. By comparing both paths, you’ll notice that the only difference is the row index (TR[x]).
    Now, deselect all attributes in the application modeller except the HTML path and make the path dynamic by replacing the row number with a placeholder (e.g., TR[{Counter}]).
  5. Create and Use a numeric Counter data item to iterate through each row dynamically.
  6. Loop to extract values

    Create a Collection to store the item prices.

    In a loop:

    - Use a Get Text action to read the value from the dynamic element (using the current counter value).

    - Use Add Row and assign the retrieved value to the collection.

    - Increment the counter and repeat the process for the next row.
  7. As a best practice, include a Check Element or Wait Stage before each Get Text action. When the element is no longer found (i.e., you've reached beyond the last row), the timeout will indicate the end of the table, and you can exit the loop.

 

You can also check out this thread for additional help: https://community.blueprism.com/t5/Product-Forum/how-to-read-a-table/td-p/86567

For a deeper understanding of browser automation in Blue Prism, I recommend reviewing this course: https://university.blueprism.com/courses?entry=110248&section=courses

Kindly let me know if you need more help on this. If you found this answer helpful, please mark this as Best Answer.

Best regards,
Sourav S
Consultant - Automation Developer
WonderBotz