Skip to content

Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.

871 B
Raw Blame
diff --git a/lib/client/ClientLifecyclesDispatcher.js b/lib/client/ClientLifecyclesDispatcher.js
index 903f8dc30b2e044fd5e1cb868ac5698b13186292..b6b60bfa5237af5d5598e3e2051760da00321159 100644
--- a/lib/client/ClientLifecyclesDispatcher.js
+++ b/lib/client/ClientLifecyclesDispatcher.js
@@ -30,9 +30,11 @@ function scrollAfterNavigation({ location, previousLocation, }) {
         window.scrollTo(0, 0);
     }
     else {
-        const id = decodeURIComponent(hash.substring(1));
-        const element = document.getElementById(id);
-        element?.scrollIntoView();
+        setTimeout(() => {
+            const id = decodeURIComponent(hash.substring(1));
+            const element = document.getElementById(id);
+            element?.scrollIntoView();
+        }, 100);
     }
 }
 function ClientLifecyclesDispatcher({ children, location, previousLocation, }) {