Extract text inside quotation marks?

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
bugmenot666
Posts: 39
Joined: Wed Apr 08, 2009 2:01 pm

Extract text inside quotation marks?

Post by bugmenot666 » Tue Oct 23, 2012 3:24 pm

So I am trying to extract the text inside of the completed items, such as those found here:

http://my.lotro.com/home/character/1178 ... tivitylog/

i am currently using this

Code: Select all

TAG POS=1 TYPE=TD ATTR=CLASS:details EXTRACT=TXT
SAVEAS TYPE=EXTRACT FOLDER=* FILE=Completionlist.csv
Which results in the entire statement being taken and saved to the csv (along with a ton of spaces before the statement)
Completed 'The Palisade: Rebuild I'
What I would like to do is to just take the material INSIDE the quotation marks. I want
The Palisade: Rebuild I
I've tried to make sense out of the SEARCH and REGEXP function but the example used with parenthesis is horrible and confusing.

http://wiki.imacros.net/SEARCH

Please help!
bugmenot666
Posts: 39
Joined: Wed Apr 08, 2009 2:01 pm

Re: Extract text inside quotation marks?

Post by bugmenot666 » Thu Oct 25, 2012 3:47 pm

Can someone help? This forum appears to be absolutely flooded with spam and I am afraid this request is being lost.
SemaST
Posts: 1
Joined: Sun Oct 28, 2012 1:40 am

Re: Extract text inside quotation marks?

Post by SemaST » Sun Oct 28, 2012 1:52 am

You can try to remove it using EVAL:

Code: Select all

TAG POS=1 TYPE=TD ATTR=CLASS:details EXTRACT=TXT
SET !VAR1 EVAL("var s=\"{{!EXTRACT}}\"; l=s.lastIndexOf(\"'\");s=s.substring((18),(l));")
SET !EXTRACT NULL
SET !EXTRACT {{!VAR1}}
SAVEAS TYPE=EXTRACT FOLDER=* FILE=Completionlist.csv
Post Reply