[PR #2807] [MERGED] Fix scraping failed bug in link/bulk link scrapers #4126

Closed
opened 2026-02-22 18:35:11 -05:00 by yindo · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/Mintplex-Labs/anything-llm/pull/2807
Author: @shatfield4
Created: 12/11/2024
Status: Merged
Merged: 12/11/2024
Merged by: @timothycarambat

Base: masterHead: 2758-bug-scraping-failed


📝 Commits (5)

  • 4944c06 fix scraping failed bug in link/bulk link scrapers
  • e6a3d9b reset submodule
  • 3a8a030 swap to networkidle2 as a safe mix for SPA and API-loaded pages, but also not hang on request heavy pages
  • 6dab199 lint
  • f28488b Merge branch 'master' into 2758-bug-scraping-failed

📊 Changes

2 files changed (+3 additions, -3 deletions)

View changed files

📝 collector/processLink/convert/generic.js (+1 -1)
📝 collector/utils/extensions/WebsiteDepth/index.js (+2 -2)

📄 Description

Pull Request Type

  • feat
  • 🐛 fix
  • ♻️ refactor
  • 💄 style
  • 🔨 chore
  • 📝 docs

Relevant Issues

resolves #2758

What is in this change?

  • Replace domcontentloaded Puppeteer option with networkidle0 which waits for all network connections to close before attempting scraping
  • domcontentloaded only waits for initial HTML document to load before continuing
  • Referenced these langchain docs and Puppeteer docs to use networkidle0 life cycle event

Additional Information

Developer Validations

  • I ran yarn lint from the root of the repo & committed changes
  • Relevant documentation has been updated
  • I have tested my code functionality
  • Docker build succeeds locally

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/Mintplex-Labs/anything-llm/pull/2807 **Author:** [@shatfield4](https://github.com/shatfield4) **Created:** 12/11/2024 **Status:** ✅ Merged **Merged:** 12/11/2024 **Merged by:** [@timothycarambat](https://github.com/timothycarambat) **Base:** `master` ← **Head:** `2758-bug-scraping-failed` --- ### 📝 Commits (5) - [`4944c06`](https://github.com/Mintplex-Labs/anything-llm/commit/4944c06d1f96e20edd1472fbbadea0ab874f0e63) fix scraping failed bug in link/bulk link scrapers - [`e6a3d9b`](https://github.com/Mintplex-Labs/anything-llm/commit/e6a3d9b6ccc1e79a61d1df4ff8cb14b361244c8f) reset submodule - [`3a8a030`](https://github.com/Mintplex-Labs/anything-llm/commit/3a8a030cb8b7fdacc53eb044991584d2492129dd) swap to networkidle2 as a safe mix for SPA and API-loaded pages, but also not hang on request heavy pages - [`6dab199`](https://github.com/Mintplex-Labs/anything-llm/commit/6dab199458a1a357050d9d483f465a596de6a775) lint - [`f28488b`](https://github.com/Mintplex-Labs/anything-llm/commit/f28488bae42cf9aa6d50ec4dc5ed1837dacb32df) Merge branch 'master' into 2758-bug-scraping-failed ### 📊 Changes **2 files changed** (+3 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `collector/processLink/convert/generic.js` (+1 -1) 📝 `collector/utils/extensions/WebsiteDepth/index.js` (+2 -2) </details> ### 📄 Description ### Pull Request Type <!-- For change type, change [ ] to [x]. --> - [ ] ✨ feat - [x] 🐛 fix - [ ] ♻️ refactor - [ ] 💄 style - [ ] 🔨 chore - [ ] 📝 docs ### Relevant Issues <!-- Use "resolves #xxx" to auto resolve on merge. Otherwise, please use "connect #xxx" --> resolves #2758 ### What is in this change? <!-- Describe the changes in this PR that are impactful to the repo. --> - Replace `domcontentloaded` Puppeteer option with `networkidle0` which waits for all network connections to close before attempting scraping - `domcontentloaded` only waits for initial HTML document to load before continuing - Referenced [these langchain docs](https://v03.api.js.langchain.com/types/_langchain_community.document_loaders_web_puppeteer.PuppeteerGotoOptions.html) and [Puppeteer docs](https://pptr.dev/api/puppeteer.puppeteerlifecycleevent) to use `networkidle0` life cycle event ### Additional Information <!-- Add any other context about the Pull Request here that was not captured above. --> ### Developer Validations <!-- All of the applicable items should be checked. --> - [x] I ran `yarn lint` from the root of the repo & committed changes - [x] Relevant documentation has been updated - [x] I have tested my code functionality - [x] Docker build succeeds locally --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
yindo added the pull-request label 2026-02-22 18:35:11 -05:00
yindo closed this issue 2026-02-22 18:35:11 -05:00
yindo changed title from [PR #2807] Fix scraping failed bug in link/bulk link scrapers to [PR #2807] [MERGED] Fix scraping failed bug in link/bulk link scrapers 2026-06-05 15:16:58 -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#4126