[GH-ISSUE #1997] [BUG]: Depth setting for Bulk Link Scraper has no effect #1297

Closed
opened 2026-02-22 18:24:09 -05:00 by yindo · 6 comments
Owner

Originally created by @mPyKen on GitHub (Jul 30, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1997

How are you running AnythingLLM?

Kubernetes

What happened?

Bulk Link Scraper discovers more links than there are on the page even though depth is set to 1.

Are there known steps to reproduce?

Open https://www.google.com on your browser and check that the html has 32 occurances of href.
Start Bulk Link Scraper on google with depth = 1 and Max Links = #occurances of href + 1 = 33 Max Links = 100.
Then check logs:

[collector] info: Discovering links...
[collector] info: Found 100 links to scrape.
[collector] info: Starting bulk scraping...

I can try to fix this if contributions are welcome

Originally created by @mPyKen on GitHub (Jul 30, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1997 ### How are you running AnythingLLM? Kubernetes ### What happened? Bulk Link Scraper discovers more links than there are on the page even though depth is set to 1. ### Are there known steps to reproduce? Open `https://www.google.com` on your browser and check that the html has 32 occurances of `href`. Start Bulk Link Scraper on google with `depth = 1` and ~`Max Links = #occurances of href + 1 = 33`~ `Max Links = 100`. Then check logs: ``` [collector] info: Discovering links... [collector] info: Found 100 links to scrape. [collector] info: Starting bulk scraping... ``` I can try to fix this if contributions are welcome
yindo added the possible bug label 2026-02-22 18:24:09 -05:00
yindo closed this issue 2026-02-22 18:24:09 -05:00
Author
Owner

@timothycarambat commented on GitHub (Jul 30, 2024):

its +1 because the root site counts as a link so that we add the origin site as well.

@timothycarambat commented on GitHub (Jul 30, 2024): its +1 because the root site counts as a link so that we add the origin site as well.
Author
Owner

@mPyKen commented on GitHub (Jul 30, 2024):

Fair enough, +1 makes sense. Let me update my reproduction steps: Is there any reason it detects more than 33 links when I set Max Links = 100 and depth = 1?

[collector] info: Discovering links...
[collector] info: Found 100 links to scrape.
[collector] info: Starting bulk scraping...
[collector] info: Scraping 1/100: https://www.google.com/imghp
...
@mPyKen commented on GitHub (Jul 30, 2024): Fair enough, +1 makes sense. Let me update my reproduction steps: Is there any reason it detects more than 33 links when I set `Max Links = 100` and `depth = 1`? ``` [collector] info: Discovering links... [collector] info: Found 100 links to scrape. [collector] info: Starting bulk scraping... [collector] info: Scraping 1/100: https://www.google.com/imghp ... ```
Author
Owner

@timothycarambat commented on GitHub (Jul 30, 2024):

@shatfield4 any ideas?

@timothycarambat commented on GitHub (Jul 30, 2024): @shatfield4 any ideas?
Author
Owner

@mPyKen commented on GitHub (Jul 30, 2024):

Hmm to me, it looks like depth is indeed being ignored in discoverLinks (condition currentLevel < depth will always be met). If it's ok I can try to fix this and create a PR

@mPyKen commented on GitHub (Jul 30, 2024): Hmm to me, it looks like depth is indeed being ignored in [discoverLinks](https://github.com/Mintplex-Labs/anything-llm/blob/3856a4d19cf925ff8177e3fcc122eeedb0198a5f/collector/utils/extensions/WebsiteDepth/index.js#L21-L40) (condition `currentLevel < depth` will always be met). If it's ok I can try to fix this and create a PR
Author
Owner

@mPyKen commented on GitHub (Aug 11, 2024):

Please let me know if this is a won't fix, help wanted or confirmation needed

@mPyKen commented on GitHub (Aug 11, 2024): Please let me know if this is a won't fix, help wanted or confirmation needed
Author
Owner

@shatfield4 commented on GitHub (Aug 12, 2024):

@mPyKen I just created a fix for this in #2096, thank you for pointing this out!

@shatfield4 commented on GitHub (Aug 12, 2024): @mPyKen I just created a fix for this in #2096, thank you for pointing this out!
yindo changed title from [BUG]: Depth setting for Bulk Link Scraper has no effect to [GH-ISSUE #1997] [BUG]: Depth setting for Bulk Link Scraper has no effect 2026-06-05 14:40:01 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#1297