Re: spider
| From: | TG | Date: | Fri, 21 Mar 2008 20:31:06 +0000 |
| Subject: | Re: spider | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-271956@lists.php.net to get a copy of this message | ||
Good call, Ray. And depending on how much you need to pull, you might also
include <img> and <iframe> src values. Also test to make sure there's an
href value for the <a> tags, they could also be <a name="somename"> without
an href.
It gets really tricky when you start looking at javascript window.open or
window.location type link sources.
-TG
----- Original Message -----
From: Ray Hauge <ray.hauge.lists@gmail.com>
To: tedd <tedd@sperling.com>
Cc: php-general@lists.php.net
Date: Fri, 21 Mar 2008 13:45:35 -0500
Subject: Re: [PHP] spider
> Have a look at something like this:
>
> http://simplehtmldom.sourceforge.net/
>
> I haven't used it, but if it works you should be able to pull up a list
> of all the <a> tags quite easily through the DOM ala:
>
> foreach($dom->find('a') as $node)
> echo $node->href . '<br>';