How to extract data from 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.

How to extract data from table ?

by newmember on Thu Mar 24, 2016 3:05 am

Hello,
Code: Select all
URL GOTO=https://chinesepod.com/tools/glossary/entry/ugly

TAG POS=1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
TAG POS=1 TYPE=A ATTR=TXT:Download&&HREF:* EXTRACT=HREF

TAG POS=2 TYPE=TD ATTR=TXT:* EXTRACT=TXT
TAG POS=2 TYPE=A ATTR=TXT:Download&&HREF:* EXTRACT=HREF

TAG POS=3 TYPE=TD ATTR=TXT:* EXTRACT=TXT
TAG POS=3 TYPE=A ATTR=TXT:Download&&HREF:* EXTRACT=HREF

SAVEAS TYPE=EXTRACT FOLDER=E:\ FILE=pinyin.csv

I use this code to extract text and URL but it always extract wrong URL.
Image
So the text doesn't match the URL. How to fix it ? Thank you very much
newmember
 
Posts: 20
Joined: Mon Mar 17, 2014 12:01 am

Re: How to extract data from table ?

by andyh2003 on Thu Mar 24, 2016 3:20 am

try changing the TAG position by 1 or 2...


TAG POS=1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
TAG POS=2 TYPE=A ATTR=TXT:Download&&HREF:* EXTRACT=HREF


or


TAG POS=1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
TAG POS=3 TYPE=A ATTR=TXT:Download&&HREF:* EXTRACT=HREF
andyh2003
 
Posts: 9
Joined: Thu Sep 17, 2015 2:26 am

Re: How to extract data from table ?

by newmember on Thu Mar 24, 2016 4:42 am

Yes. It worked :)
newmember
 
Posts: 20
Joined: Mon Mar 17, 2014 12:01 am

Re: How to extract data from table ?

by chivracq on Thu Mar 24, 2016 6:08 am

newmember wrote:Hello,
Code: Select all
URL GOTO=https://chinesepod.com/tools/glossary/entry/ugly

TAG POS=1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
TAG POS=1 TYPE=A ATTR=TXT:Download&&HREF:* EXTRACT=HREF

TAG POS=2 TYPE=TD ATTR=TXT:* EXTRACT=TXT
TAG POS=2 TYPE=A ATTR=TXT:Download&&HREF:* EXTRACT=HREF

TAG POS=3 TYPE=TD ATTR=TXT:* EXTRACT=TXT
TAG POS=3 TYPE=A ATTR=TXT:Download&&HREF:* EXTRACT=HREF

SAVEAS TYPE=EXTRACT FOLDER=E:\ FILE=pinyin.csv

I use this code to extract text and URL but it always extract wrong URL.
Image
So the text doesn't match the URL. How to fix it ? Thank you very much

CIM...! :mrgreen:
(Wondering btw if you are still using Pale Moon (like me)...)

andyh2003 wrote:try changing the TAG position by 1 or 2...

Code: Select all
TAG POS=1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
TAG POS=2 TYPE=A ATTR=TXT:Download&&HREF:* EXTRACT=HREF

or
Code: Select all
TAG POS=1 TYPE=TD ATTR=TXT:* EXTRACT=TXT
TAG POS=3 TYPE=A ATTR=TXT:Download&&HREF:* EXTRACT=HREF

newmember wrote:Yes. It worked :)

Yep, but using Relative Positioning would probably be more reliable.
If any HTML Element is added on the Page with a Link, you will again extract the wrong URL...
- (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: 6489
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: No registered users and 2 guests

cron
-->