elementHandle.getProperties() returns an empty map - which i think is a bug
See original GitHub issueFor the following html…
<form class="" action="index.html" method="post">
<input type="text" name="some name" placeholder="some placeholder" value="">
</form>
Im trying to extract the properties like so:
const formHandle = await page.$('form')
const inputs = await formHandle.$$('input')
const properties = await inputs[0].getProperties()
The relevant documentation is here: elementHandle.getProperties()
My inputs[0]
is indeed an elementHandle
, since it comes form the formHandle as shwon here: elementHandle.$()
But why is the properties
map empty then? Given that html form
is supposed to contain : name
, type
, placeholder
and value
If i use await inputs[0].getProperty("placeholder")
then it works as expected.
Does this mean that the elementHandle.getProperties()
function is not actually working?!
Issue Analytics
- State:
- Created 4 years ago
- Reactions:10
- Comments:5
Top Results From Across the Web
What's the expected behavior of puppeteer's ElementHandle ...
It looks like puppeteer's getProperty() actually tries to parse the style in some way, which parsing is buggy/incomplete. The only way to get ......
Read more >webdriverio/webdriverio - Gitter
let's start by removing the empty browser.pause(); ... I think there might be a mistake somewhere in the testcode or it might be...
Read more >puppeteer document is not defined - You.com | The AI Search ...
I think document would only be available within page.evaluate (according to puppeteer ... const isDone = await this.page.evaluate(`(async() => { return new ...
Read more >mozilla-central: changeset 488667 ...
getIntPref( "devtools.netmonitor.panes-search-height" ); + return ... IsComplete(), + "Sheet thinks it's not complete while we think it is") ...
Read more >Remove Hibernate from Project due to GPL license - Apache
Moved an icon from the Hibernate Module to the j2ee.persistence module as its used for the mapping file icon.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Having the same issue here.
For example when trying to extract an XPath from information link the following works just fine:
However when trying to get all the properties:
Here link returns an empty map
Map(0) {}
and so I can’t get the href property.I need a way to get all the properties from element handler as an object but I couldn’t find any other way to do that other than getProperties
I have the same issue. How can I get all properties of element?