Extract text from HTML tag

Get help with installation and running here.

Moderators: DataMystic Support, Moderators, DataMystic Support, Moderators, DataMystic Support, Moderators

Post Reply
asoydah
Posts: 4
Joined: Tue Aug 26, 2008 10:03 am

Extract text from HTML tag

Post by asoydah »

How can i extract the text from HTML tag?
Example :
<h3><b><a name="F5">Family SUV / Wagon</a></b></h3>
<h4>Mitsubishi Outlander or similar</h4>
<ul>
<li>4 door SUV</li>
<li><b>Auto</b>, Power Steering, MP3/CD player</li>
<li>Air Conditioning</li>
<li>

I want to extract to be an XML file like
<name>Mitsubishi Outlander or similar</name>
<desc>Family Suv</desc>

can someone help me with the filter?
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Extract text from HTML tag

Post by DataMystic Support »

Use an EasyPattern search/replace with Extract option turned on.

Replace variable sections with:
[ capture(1+ chars) as 'car' ]
asoydah
Posts: 4
Joined: Tue Aug 26, 2008 10:03 am

Re: Extract text from HTML tag

Post by asoydah »

Sorry for being the idiot here.. :(
but which one should I replace?
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Extract text from HTML tag

Post by DataMystic Support »

Are you buying TextPipe Pro..? Have you looked at the web site mining docs at http://www.datamystic.com/docs ?
User avatar
Fixer
Posts: 25
Joined: Thu Jul 31, 2008 6:39 am
Location: European Union > Poland
Contact:

Re: Extract text from HTML tag

Post by Fixer »

Hi asoydah
I made for You filter in TextPipe.
Download it here: http://plikojad.pl/bbg79d7lxszl (cars.rar > unzip to cars.fll and open it)
:)

Result:

Code: Select all

<cars>
  <name>Mitsubishi Outlander or similar</name>
  <desc>Family SUV / Wagon</desc>
    <option>4 door SUV</option>
    <option><b>Auto</b>, Power Steering, MP3/CD player</option>
    <option>Air Conditioning</option>
</cars>
User avatar
DataMystic Support
Site Admin
Posts: 2227
Joined: Mon Jun 30, 2003 12:32 pm
Location: Melbourne, Australia
Contact:

Re: Extract text from HTML tag

Post by DataMystic Support »

Thanks Fixer!
asoydah
Posts: 4
Joined: Tue Aug 26, 2008 10:03 am

Re: Extract text from HTML tag

Post by asoydah »

Thx Fixer.. I already click that but can't download anything?
Maybe that's a broken link?
User avatar
Fixer
Posts: 25
Joined: Thu Jul 31, 2008 6:39 am
Location: European Union > Poland
Contact:

Re: Extract text from HTML tag

Post by Fixer »

No it works! Oh gosh...
You must click twice! (first on the link and next on the file cars.rar)
But ok don't worry try now click this directly link: http://plikojad.pl/download/bbk4h4wsehn ... 642cd74058

Image
Post Reply