Forum Moderators: coopster

Message Too Old, No Replies

Grabbing a link out of a line of HTML

how to do it?

         

wfernley

6:26 pm on Oct 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I currently have a huge function that will crawl a page of a site and grab all the links off the page. There seems to be a problem though by grabbing the link text. I was curious how I can improve my function. I thought about posting it but then realized its huge, ugly and well.....embarrassing ;)

So I was curious if anyone knows how I can make a function that will grab "info@test.com" out of this line:

Just some text. <a href="mailto:info@test.com">Contact Us.</a>.

The main problem I come up with is sometimes it will grab the "Contact Us" or it screws up when they have additional values in the <a href> tag.

Can anyone help?

If you need more info, let me know!

Thanks!

Wes

vincevincevince

8:21 pm on Oct 11, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



My first thoughts were to try this code:


$isp = "foo.foo"; //your ISP without www. or http://
$myname = "John Brown"; //change to your full name
mail("abuse@$isp","I am harvesting emails, please ban me","My name is $myname");

But I thought that I could more usefully point you to [php.net...]