simonradier / node-red-contrib-simple-webdriver

SimpleWebdriver nodes for Node-RED initially based on node-red-contrib-selenium-wd2
Apache License 2.0
14 stars 8 forks source link

Get Attribute - InnerHTML #13

Closed edge360 closed 1 year ago

edge360 commented 1 year ago

Hi, I'm trying to get the HTML source of an Element using the Get Attribute node. I'm currently entering "innerHTML" as the attribute, but this is returning a null payload. I'm not sure if this was espected since not all drivers appear to support this or whether there was another method to accomplish this. I saw "console.log(arguments[0].innerHTML)" in the Script node, but wasn't sure how I could redirect that js output to the node-red interface.

Thanks!

simonradier commented 1 year ago

Hi @edge360,

This is because innerHTML is not an attribute it is a property. I'll provide an update to the get-attribute node to switch to property during the week.

Best regards,

simonradier commented 1 year ago

Hello,

Give a try to alpha-12. It should allow you to retreive innerHTML by switch to "Property" mode.

Best regards,

edge360 commented 1 year ago

@simonradier

Yes! It works exactly as expected, thank you!