Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Re: Re: Parsing HTML with TreeBuilder

by Chmrr (Vicar)
on Sep 20, 2002 at 07:25 UTC ( #199398=note: print w/ replies, xml ) Need Help??


in reply to Re: Re: Parsing HTML with TreeBuilder
in thread Parsing HTML with TreeBuilder

Assuming that $ele is an HTML::Element object containing your <td> element, then:

if (grep {!ref($_) or $_->tag ne "a"} $td->content_list) { # The element has non-link text } else { # The element only has <a></a> elements in it }

See the HTML::Element documentation for more information. There may be a more efficient method than the above, but you havn't specified your problem well enough for me to see it.

perl -pe '"I lo*`+$^X$\"$]!$/"=~m%(.*)%s;$_=$1;y^`+*^e v^#$&V"+@( NO CARRIER'


Comment on Re: Re: Re: Parsing HTML with TreeBuilder
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://199398]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2014-07-26 03:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (175 votes), past polls