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

Publish a library support use in playwright ? #723

Open
valbendan opened this issue Jul 22, 2021 · 2 comments
Open

Publish a library support use in playwright ? #723

valbendan opened this issue Jul 22, 2021 · 2 comments

Comments

@valbendan
Copy link

@valbendan valbendan commented Jul 22, 2021

Is your feature request related to a problem? Please describe.
I think SingleFile(Z) is perfect use to archive web pages, but I prefer the programmable way

Describe the solution you'd like
It would be awesome we have a api: SingleFile(page: Page, save_file_path: string, options: object)

Describe alternatives you've considered (optional)
Use cli version

Additional context (optional)

@gildas-lormeau
Copy link
Owner

@gildas-lormeau gildas-lormeau commented Jul 22, 2021

You can already do that.

Install SingleFile from npm:

npm install "gildas-lormeau/SingleFile#master"

Then, you can import the JS API and use SingleFile in a Node.js script.

const { initialize } = require("single-file");
const singlefile = await initialize(options);
await singlefile.capture(urls);
await singlefile.finish();

@valbendan
Copy link
Author

@valbendan valbendan commented Jul 23, 2021

I think I need do some interect with the page before capture.

eg: I have to login/click some menu before capture(otherwise the content is not what I want).

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

Successfully merging a pull request may close this issue.

None yet
2 participants