Extract Txt for DIV Class

Discussions and Tech Support specific to the iMacros Firefox add-on.
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
shamus
Posts: 5
Joined: Thu Jun 30, 2016 8:21 pm

Extract Txt for DIV Class

Post by shamus » Thu Jun 30, 2016 8:28 pm

Hi

I'm very new to iMacro so still finding my way. but I am having a little trouble trying to extract some text. I have attached a pic of the text I'm trying to extract.

I have been able to extract the <strong> with the following code: TAG POS=1 TYPE=strong ATTR=TXT:* EXTRACT=TXT

What do I need to do to also extract the the text 'This IP is already on your hacked database'
Attachments
DIV.png
chivracq
Posts: 9378
Joined: Sat Apr 13, 2013 1:07 pm
Location: Amsterdam (NL)

Re: Extract Txt for DIV Class

Post by chivracq » Thu Jun 30, 2016 11:52 pm

shamus wrote:Hi

I'm very new to iMacro so still finding my way. but I am having a little trouble trying to extract some text. I have attached a pic of the text I'm trying to extract.

I have been able to extract the <strong> with the following code: TAG POS=1 TYPE=strong ATTR=TXT:* EXTRACT=TXT

What do I need to do to also extract the the text 'This IP is already on your hacked database'
CIM...! :mrgreen: (Always mention your FCI when you open a Thread, read my Sig, many Commands are not implemented for all Browsers/Versions...)

Quick look at your Qt: => Yep, 'EXTRACT=TXT' on any of the 4 nested 'DIV' Elements, I would think...
- (F)CI(M) = (Full) Config Info (Missing): iMacros + Browser + OS (+ all 3 Versions + 'Free'/'PE').
- I don't even read the Qt if that (required) Info is not mentioned...!
- Script & URL help a lot for more "educated" Help...
shamus
Posts: 5
Joined: Thu Jun 30, 2016 8:21 pm

Re: Extract Txt for DIV Class

Post by shamus » Fri Jul 01, 2016 9:09 am

Thanks for the response. Noted on the CIM

Firefox: 47.0
iMacro: 8.9.7 Extension
OS: Win 10

That works, I changed the CLASS to "alert alert-error" and that extracted the full string.

'Hack the IP.

TAG POS=1 TYPE=DIV ATTR=CLASS:"alert alert-error" EXTRACT=TXT
SET !VAR3 {{!EXTRACT}}
SET !EXTRACT NULL

CSV extract to file. "Error! This IP is already on your hacked database. "
Post Reply