Skip to content

Commit

Permalink
Update .text method
Browse files Browse the repository at this point in the history
  • Loading branch information
Kikobeats committed Feb 8, 2018
1 parent 6a690d2 commit 3ec3bb9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions examples/text.js
@@ -0,0 +1,13 @@
'use strict'

const { URL } = require('url')

const createBrowserless = require('..')
const browserless = createBrowserless()

const url = new URL(process.argv[2])
;(async () => {
const text = await browserless.text(url.toString())
console.log(text)
process.exit()
})()
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -20,7 +20,7 @@ module.exports = launchOpts => {
const page = await newPage()

await page.goto(url, opts)
const text = page.plainText()
const text = await page.evaluate(() => document.body.innerText)

page.close()
return text
Expand Down

0 comments on commit 3ec3bb9

Please sign in to comment.