Skip to content
This repository has been archived by the owner on Nov 24, 2018. It is now read-only.

Add .html method #74

Closed
Kikobeats opened this issue Jul 28, 2017 · 4 comments
Closed

Add .html method #74

Kikobeats opened this issue Jul 28, 2017 · 4 comments
Labels

Comments

@Kikobeats
Copy link

Hello guys, thanks for sharing this project, it's awesome

Do you think could be more or less easy add an .html for output rendered HTML?

Example:

const html = await chromeless
    .goto('https://www.github.com')
    .wait(5) // ideally wait until HTML is ready
    .html()
@adieuadieu adieuadieu added the API label Jul 28, 2017
@vladholubiev
Copy link
Contributor

Just in case it may be useful until feature lands into master

const html = await chromeless
    .goto('https://www.github.com')
    .wait(5 * 1000)
    .evaluate(() => document.documentElement.outerHTML);

@Kikobeats
Copy link
Author

@vladgolubev thanks for the response!

One thing I'm thinking all the time is, instead of wait an arbitrary quantity of time, could be possible wait until an DOM event is emitted?

Something like

const html = await chromeless
    .goto('https://www.github.com')
    .wait('DOMContentLoaded')
    .html()

@seangransee
Copy link
Contributor

seangransee commented Jul 31, 2017

I implemented this in #112. I named it getHtml() to avoid confusion with setHtml().

EDIT: This has been renamed to html() in #143.

@adieuadieu
Copy link
Collaborator

.html() Implemented in #112. Watch out for the current 128KB size limitation as noted in #114. Waiting for event to fire is being tracked in #98.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants