Rahul Joshi <[EMAIL PROTECTED]> writes:
> The issue of specifying or limiting the number of
> links followed in every page:
>
> Can anybody suggest the source file change or otherwise that I can
> make to do this? I am not familiar with WGet source, so I would
> appreciate any inputs...
In src/recur.c there is a loop that looks like this:
for (; child; child = child->next)
{
if (child->ignore_when_downloading)
continue;
if (dash_p_leaf_HTML && !child->link_inline_p)
continue;
if (download_child_p (child, url_parsed, depth,
start_url_parsed,
blacklist))
{
url_enqueue (queue, xstrdup (child->url->url),
xstrdup (url), depth + 1,
child->link_expect_html);
/* We blacklist the URL we have enqueued, because we
don't want to enqueue (and hence download) the
same URL twice. */
string_set_add (blacklist, child->url->url);
}
}
You can make your change there -- count the links enqueued and break
out of the loop when the desired number is exceeded. Good luck.