Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re^2: How to strip everything in a string except HTML Link

by Anonymous Monk
on May 15, 2015 at 07:32 UTC ( [id://1126745]=note: print w/replies, xml ) Need Help??


in reply to Re: How to strip everything in a string except HTML Link
in thread How to strip everything in a string except HTML Link

But in there, you know the base:

my $base = 'http://perlmonks.org/';
I will have no idea what they are, could be any news affiliate website in the world.

I just want to remove the other stuff and leave what is in the html link:

Link: <a href="http://example.com">and Anchor</a>
If that above were the string, it would remove Link: and leave the rest.

my $string = q~Link: <a href="http://example.com">and Anchor</a>~; $string =~ s/<[a href.... # I cannot remember this string. There was o +ne that worked perfect, even if the link had target="_blank" it did n +ot matter what else it had... but I cannot find it in any of my files + or remember who to write it.


Also, I've at this point already downloaded the one page they are all on, and I've parsed it down to just one table cell, that has other data in it and I've gotten out of that table cell the information I need, all that is left is the remnants including the html link with anchor... so I want to just use that string to remove everything left, except the link and anchor.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others learning in the Monastery: (4)
As of 2024-04-20 00:57 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found