urltext remove tag attributes

Post Reply
roboto
Posts: 14
Joined: Sat Jul 31, 2010 11:45 am

urltext remove tag attributes

Post by roboto »

How to get just a text from a tag?

Example:

<td class="sample text">
<a href="foo.html">sample text</a>
User avatar
mark
Site Admin
Posts: 5519
Joined: Tue Apr 25, 2000 6:56 pm

urltext remove tag attributes

Post by mark »

Not entirely clear on what you want. If you want to extract text from HTML try
<$Html='
<td class="sample text">
<a href="foo.html">sample text</a>
'>
<fetch "http://localhost/index.html" $Html>
<urlinfo text>
<$Text=$ret>

If you're looking to extract something from a snippet you might use:
<rex ">><a =[^>]+>\P=!</a>+\F</a>" $Html>
<$Text=$ret>
Post Reply