Re: List all links from a webpage
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: List all links from a webpage

From: Toby Inkster <usenet200508@tobyinkster.co.uk>
Date: Sat Sep 03 2005 - 16:14:23 CEST

Robertico wrote:

> I'd like to list all links (url's, not interested in email adresses) from a
> web page (htm, html, asp, php ...).

<?php
        $url = 'http://tobyinkster.co.uk';
        $n = 12 + strlen(`lynx -dump -number_links -nolist '$url'`);
        $list = substr(`lynx -dump -number_links '$url'`, $n);
        print "<pre>$list</pre>";
?>

Magic.

-- 
Toby A Inkster BSc (Hons) ARCS
Contact Me  ~ http://tobyinkster.co.uk/contact
Received on Mon Oct 24 02:09:45 2005