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.

Fixing liveview with HTTP

Marek Trunkatc25de1c4d4c1
diff --git a/src/puppeteer_live_view_client.js b/src/puppeteer_live_view_client.js
index 02f9e5420..cd9dacb1c 100644
--- a/src/puppeteer_live_view_client.js
+++ b/src/puppeteer_live_view_client.js
@@ -274,7 +274,7 @@ export const layout = (url) => {
<div id="index">Waiting for WebSocket connection.</div>
<div id="page-detail" class="hidden"></div>
<script>
- const ws = new WebSocket("${url.replace('https', 'wss')}");
+ const ws = new WebSocket("${url.replace('https', 'wss').replace('http', 'ws')}");
const DESTROY_FADEOUT_MILLIS = ${DESTROY_FADEOUT_MILLIS};
const createPage = ${createPage.toString()};
const createPageCollection = ${createPageCollection.toString()};