-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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
Add .content() method. Fixes #406. #419
Conversation
Thanks for your pull request. It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). 📝 Please visit https://cla.developers.google.com/ to sign. Once you've signed, please reply here (e.g.
|
I signed it! |
CLAs look good, thanks! |
Does |
See also: #406 (comment) |
Thanks so much! This has been my first time interacting with an open source library and it's been really great being supported. |
@vsemozhetbyt Oh, I'm not aware of any! I could give that a try for just the doctype, simplifying the logic a bit. I wanted to avoid using it for the full document as it then became an XML document (which can be pretty different from what was originally intended). I'll update the PR to serialize the doctype. |
861d76d
to
13da2ff
Compare
docs/api.md
Outdated
@@ -462,6 +463,11 @@ Shortcut for [page.mainFrame().focus(selector)](#framefocusselector). | |||
#### page.frames() | |||
- returns: <[Array]<[Frame]>> An array of all frames attached to the page. | |||
|
|||
#### page.getContent() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's go with page.content()
, we don't have "get" prefixes in other API calls (e.g. page.plainText()
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aslushnikov thank you for the review! I've just updated it to be .content()
instead of .getContent()
.
13da2ff
to
b088a76
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
You're very welcome! Thank you for the review! |
This adds a new method:
.content()
which is the counterpart of.setContent()
, retrieving the HTML contents of the page, including the doctype (if there is one).