Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

is it possible to dump the html that the terminal renders? #132

Open
angel-git opened this issue Feb 20, 2023 · 10 comments
Open

is it possible to dump the html that the terminal renders? #132

angel-git opened this issue Feb 20, 2023 · 10 comments

Comments

@angel-git
Copy link

First of all, fantastic job! 🥳

Since this browser deals with javascript would be great to wait until the DOMContentLoaded event and get a snapshot how the HTML looks like. The use case would be that instead of using old curl you could query a page that uses some JS framework, let's say react, and then you get how the page actually looks like after all that javascript:

Something like carbonyl https://google.fr --dump index.html

Thanks

@piranna
Copy link

piranna commented Jun 23, 2023

Output would be a text stream with ANSI codes, isn't It?

@angel-git
Copy link
Author

Output would be a text stream with ANSI codes, isn't It?

I guess as long as it can be human readable (or easily converted) should be fine :)

@piranna
Copy link

piranna commented Jun 23, 2023

I guess as long as it can be human readable (or easily converted) should be fine :)

Dump as an image is dumb, there are already other tools for that.

@ssb22
Copy link

ssb22 commented Jun 23, 2023

Output would be HTML. So for example if the input is <script>document.write("<"+"hr>")</script> the output would be <hr>

@piranna
Copy link

piranna commented Jun 23, 2023

I think they are different things, you are asking about a dump of the DOM, that's already feasable. I'm talking about doing screenshots, but instead of imagen, text output.

@angel-git
Copy link
Author

That was what i was looking for, get the html page after the javascript run, is it possible now? How?

@piranna
Copy link

piranna commented Jun 23, 2023

There's lote of other tools that can do It: Selenium, PhantomJS...

@ssb22
Copy link

ssb22 commented Jun 23, 2023

Yes you can do it using Selenium with Headless Chrome or Headless Firefox (or the no longer maintained PhantomJS), but that takes loads of RAM and sometimes hangs, so it would be nice to have a lighter weight alternative if possible. Edbrowse can do it but has more limited DOM support so it doesn't work on all sites.

@piranna
Copy link

piranna commented Jun 23, 2023

I think RAM usage of Carbonyl would be similar to Chrome.

@med-ab
Copy link

med-ab commented Jun 20, 2024

chromium already has --dump-dom if that's useful

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

No branches or pull requests

4 participants