-
Notifications
You must be signed in to change notification settings - Fork 3
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
Get Value From Attribute #4
Comments
Now we have For example we can now do: // html: <input id="username" user-id="2">
await Sinco.evaluatePage(() => {
return document.getElementById("username").getAttribute("user_id") // "2"
}) |
can add it to element class? eg function attribute(name: string) {
send("document.querySelector(this.selector)[name]
} |
Following v4, it should be: async function attribute(name: string, value?: string) {
if (value) {
return await this.#page.evaluate(`${this.method}('${this.selector}').setAttribute('${name}', '${value}')`)
}
return await this.#page.evaluate(`${this.method}('${this.selector}').getAttribute('${name}')`)
} |
or im thinking |
Gonna try start working on this, this week |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Summary
What: Add a public method to
HeadlessBrowser
to get the value for a given elements attributeThe text was updated successfully, but these errors were encountered: