cancel
Showing results for 
Search instead for 
Did you mean: 

Identifying End of Table

Venkata_Sreedha
Level 4
I have a HTML page which has a table in it. I need to read the table data and process it. When I spied the HTML table, blue prism is not identifying it as a table element but is identifying as a HTML Element. so when I used get table action to get the table data, I am not getting the table data in rows in collection but am getting entire data as a single row which I cannot process. To resolve the issue, I got the HTML path of first row and used a counter in the logic to increment the HTML tag which would read each row data sequentially. At the end of table, when I try to read the next element, since the logic reached end of the table, I will get a time out at which point, I know that I read all the data in the table. Once I get the timeout, I will process the read data. This logic is working fine but I am trying to see if there is a better way to achieve this solution instead of depending on the timeout, the reason being, timeout is causing the overall bot execution time to increase. Currently, when I run the bot in debug mode, the timeout action is taking about 8 seconds to timeout. I am not sure if the bot would take the same time when executed from control room, but either way, if I can identify the end of table without timing out, it would speed up the bots execution time. Attached the screenshots of table source and blueprism logic. Appreciate any thoughts on this.
7 REPLIES 7

NarendraMundwad
Level 4
Can you want to post a pic of HTML path generated when you spy one cell of the table?

Venkata_Sreedha
Level 4
Please find the attachment having the HTML path. As you can see, I am not getting the element type as a table.

Venkata_Sreedha
Level 4
attached the syped table

Venkata_Sreedha
Level 4
here is the output of get table action

NarendraMundwad
Level 4
HTML Element is fine. It works for me. With your HTML path, delete the last part of it until you reach table and highlight to see if that matches what you are looking for.If not keep going back in the path till you find another table tag. For eg: If this is original path /HTML/BODY(1)/DIV(1)/DIV(1)/DIV(1)/DIV(1)/DIV(1)/DIV(2)/DIV(1)/DIV(1)/DIV(1)/DIV(2)/DIV(2)/DIV(1)/DIV(1)/DIV(3)/DIV(1)/TABLE(1)/TBODY(1)/TR(3)/TD(1)/TABLE(2)/TBODY(1)/TR(2)/TD(1)/DIV(1)/DIV(1)/DIV(1) You delete the last part so that it looks as below /HTML/BODY(1)/DIV(1)/DIV(1)/DIV(1)/DIV(1)/DIV(1)/DIV(2)/DIV(1)/DIV(1)/DIV(1)/DIV(2)/DIV(2)/DIV(1)/DIV(1)/DIV(3)/DIV(1)/TABLE(1)/TBODY(1)/TR(3)/TD(1)/TABLE(2)/ Now highlight or try with even shorter path like below /HTML/BODY(1)/DIV(1)/DIV(1)/DIV(1)/DIV(1)/DIV(1)/DIV(2)/DIV(1)/DIV(1)/DIV(1)/DIV(2)/DIV(2)/DIV(1)/DIV(1)/DIV(3)/DIV(1)/TABLE(1)/

Anonymous
Not applicable
Vsnalam, HTML table is not in the drop down?  I usually check in the drop down and if its a table, HTML table would be one of the options.

BellaKoh
Level 3
I faced a similar issue before - except that BP was able to identify my element as a table, but there was some issues in the retrieved data. Not sure if this will work for you but you can try. Look into the HTML code of the table, and find an identifier for each row. For example, my table was a result of searching for a particular policy number. Hence, if there are 5 rows of data, there will be 5 instances of ""searchvalue=P1034I32"" in the HTML code. Use 'Get HTML' action to retrieve the HTML of the element. Use Len() function to get the number of characters of the (1) table identifier (2) HTML code of the element. Use Replace() function to replace the table identifiers in the HTML code to blanks. Get the number of characters using Len() again. Number of table rows = ([Count of HTML]-[Count of Amended HTML])/[Count of Table Identifier] This saved me up to 2 minutes, as the timeout was taking around that much time. The above steps took only a split second when used in control room.