-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
25 lines (19 loc) · 730 Bytes
/
index.js
File metadata and controls
25 lines (19 loc) · 730 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
const puppeteer = require('puppeteer');
const readline = require('readline-sync');
let name = readline.question("Type/Paste the complete link (ex. http://example.com )\n");
console.log("Input URL is " + name );
(async function main() {
try {
const browser = await puppeteer.launch();
const [page] = await browser.pages();
await page.setDefaultNavigationTimeout(0);
await page.goto(name, { waitUntil: 'load',
// Remove the timeout
timeout: 0 });
const data = await page.evaluate(() => document.querySelector('*').outerHTML);
console.log(data);
await browser.close();
} catch (err) {
console.error(err);
}
})();