First column of a table

Discussions and Tech Support related to website data extraction, screen scraping and data mining using iMacros.

Moderators: Community Moderators, iMacros Moderators

Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the Google search box (at the top of each forum page) to see if a similar problem or question has already been addressed. This will search the entire contents of the forums as well as the iMacros Wiki.
3. We can respond much faster to your posts if you include the following information:

CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST

Answering your own posts (e.g. attempting to "bump" your topic) drops your topic from the list of unanswered threads, so it may actually receive less views.

First column of a table

by Falastur on Sat May 28, 2016 7:08 am

Hi,

I have to extract the 3rd column's cell of the first row table that has in the 1st column a certain name.

the table looks like:
Code: Select all
<tr><td class="name">Name1</td><td class="name">Name2</td><td><span>ITEMtoEXTRACT</span></td></tr>


till now I've written this code:
Code: Select all
TAG POS=1 TYPE=TD ATTR=CLASS:crest-player-name&&TXT:Name1
TAG POS=R1 TYPE=TD ATTR=TXT:*:*:* EXTRACT=TXT
SET !VAR1 {{!EXTRACT}}


That's working fine, but it extracts the 3rd cell also if Name1 is in the second cell. As you see,the 1st and the 2nd cell have the same ATTR.

What should I do?
Falastur
 
Posts: 1
Joined: Sat May 28, 2016 6:52 am

Re: First column of a table

by chivracq on Sun May 29, 2016 2:45 pm

Falastur wrote:Hi,

I have to extract the 3rd column's cell of the first row table that has in the 1st column a certain name.

the table looks like:
Code: Select all
<tr><td class="name">Name1</td><td class="name">Name2</td><td><span>ITEMtoEXTRACT</span></td></tr>


till now I've written this code:
Code: Select all
TAG POS=1 TYPE=TD ATTR=CLASS:crest-player-name&&TXT:Name1
TAG POS=R1 TYPE=TD ATTR=TXT:*:*:* EXTRACT=TXT
SET !VAR1 {{!EXTRACT}}


That's working fine, but it extracts the 3rd cell also if Name1 is in the second cell. As you see,the 1st and the 2nd cell have the same ATTR.

What should I do?

Sorry it took some time to approve your Post/Thread, I was away for the WE and didn't have Internet... :oops:

Now to speed up getting some Help...:
CIM...! :mrgreen: Read my Sig for Required Info to include each time you open a Thread, many Commands are not implemented for all Browsers/Versions...

And, hum..., difficult to come up with a Solution without the URL of your Site/Page or some HTML Saveas of your Page uploaded to your Thread (zipped, max 256Kb) to see the Structure of the Page/Table and see what kind of Data you have in the Table...
And, hum again...!, even then, I don't promise I will help you as I see that your Script is for a Game and I'm usually not too keen to help Users (to "cheat") for Games, but other (Advanced) Users might...

Using Double Relative Positioning might help, or using a Double Extraction on 'R1' + 'R2' or 'R1' + 'R-1' and using 'EVAL()' to compare the Extracts might help...
- (F)CIM = (Full) Config Info Missing: iMacros + Browser + OS with all 3 Versions...
- I usually don't even read the Question if that (required) Info is not mentioned...
- Script & URL usually help a lot for a more "educated" Help...
chivracq
 
Posts: 6474
Joined: Sat Apr 13, 2013 6:07 am
Location: Amsterdam (NL)


Return to Data Extraction and Web Screen Scraping

Who is online

Users browsing this forum: Google [Bot] and 1 guest

-->