Extract last CELL from table

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information: CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
mepsztejn
Posts: 1
Joined: Wed Sep 14, 2011 6:50 am

Extract last CELL from table

Post by mepsztejn » Wed Sep 14, 2011 6:57 am

Hi,

I'm looking for a way to extract text inside the last cell of an html table.

The number of rows in this table always changes...

I also need a way to do relative extract using this last cell as starting point. Example: I'd like to extract text from the second cell before the last
MattBell7
Posts: 627
Joined: Thu Nov 26, 2009 11:07 am
Location: United Kingdom

Re: Extract last CELL from table

Post by MattBell7 » Wed Sep 14, 2011 8:41 am

Select the table
Select the next object after the table (regardless of what it is)
select the previous cell. This will be the last cell in the table.
Then you can select the cell before that to get the second to last.

code (untested, written from memory) :
TAG POS=1 TYPE=TABLE ATTR=TXT:*
TAG POS=R1 TYPE=* ATTR=TXT:*
TAG POS=R-1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
TAG POS=R-1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
Post Reply