Method: PHPCrawler::setFollowMode()



Sets the basic follow-mode of the crawler.
Signature:

public setFollowMode($follow_mode)

Parameters:

$follow_mode int The basic follow-mode for the crawling-process (0, 1, 2 or 3).

Returns:

bool 

Description:

The following list explains the supported follow-modes:

0 - The crawler will follow EVERY link, even if the link leads to a different host or domain.
If you choose this mode, you really should set a limit to the crawling-process (see limit-options),
otherwise the crawler maybe will crawl the whole WWW!

1 - The crawler only follow links that lead to the same domain like the one in the root-url.
E.g. if the root-url (setURL()) is "http://www.foo.com", the crawler will follow links to "http://www.foo.com/..."
and "http://bar.foo.com/...", but not to "http://www.another-domain.com/...".

2 - The crawler will only follow links that lead to the same host like the one in the root-url.
E.g. if the root-url (setURL()) is "http://www.foo.com", the crawler will ONLY follow links to "http://www.foo.com/...", but not
to "http://bar.foo.com/..." and "http://www.another-domain.com/...". This is the default mode.

3 - The crawler only follows links to pages or files located in or under the same path like the one of the root-url.
E.g. if the root-url is "http://www.foo.com/bar/index.html", the crawler will follow links to "http://www.foo.com/bar/page.html" and
"http://www.foo.com/bar/path/index.html", but not links to "http://www.foo.com/page.html".