filesite
6 months ago
7 changed files with 89 additions and 46 deletions
@ -1,21 +1,22 @@ |
|||||||
import Hero from '@ulixee/hero'; |
import Hero from '@ulixee/hero'; |
||||||
|
|
||||||
(async () => { |
(async () => { |
||||||
const hero = new Hero({ connectionToCore: 'ws://127.0.0.1:1818' }); |
const hero = new Hero({ connectionToCore: 'ws://127.0.0.1:1818' }); |
||||||
|
|
||||||
//const url = 'https://filesite.io';
|
//const url = 'https://filesite.io';
|
||||||
//const url = 'https://www.google.com';
|
//const url = 'https://www.google.com';
|
||||||
const url = 'https://v.douyin.com/iJr1NsJJ/'; |
let url = 'https://v.douyin.com/iJr1NsJJ/'; |
||||||
await hero.goto(url, { |
|
||||||
timeoutMs: 20000, |
|
||||||
referrer: '-' |
|
||||||
}); |
|
||||||
|
|
||||||
const title = await hero.document.title; |
await hero.goto(url, { |
||||||
console.log("Page title:\n", title); |
timeoutMs: 20000, |
||||||
|
referrer: '-' |
||||||
|
}); |
||||||
|
|
||||||
await hero.close(); |
const title = await hero.document.title; |
||||||
|
console.log("Page title:\n", title); |
||||||
|
|
||||||
|
await hero.close(); |
||||||
})().catch(error => { |
})().catch(error => { |
||||||
console.error("Error got:\n%s", error); |
console.error("Error got:\n%s", error); |
||||||
process.exit(1); |
process.exit(1); |
||||||
}); |
}); |
||||||
|
Loading…
Reference in new issue