kaliiiiiiiiii / Selenium-Driverless

undetected Selenium without usage of chromedriver
https://kaliiiiiiiiii.github.io/Selenium-Driverless/
Other
412 stars 52 forks source link

get_dom_attribute('class') returns Error #42

Closed Deimmm closed 10 months ago

Deimmm commented 10 months ago

OS: Windows Chrome: 115

Can't get dom attributes, looks like output format has changed

#MyCode
print("TC: ", torunamentsContainer.get_dom_attribute('class'))

Error:
site-packages\selenium_driverless\types\webelement.py line 361, in get_dom_attribute
    key, value = attr.split("=")
ValueError: not enough values to unpack (expected 2, got 1)

#Added log after getting attr_str
        attr_str: list = await self._driver.execute_cdp_cmd("DOM.getAttributes", {"nodeId": await self.node_id})
        print(attr_str)

{'attributes': ['class', 'stack x-stretch y-center gap-medium padding-small direction-vertical padding-left-auto padding-top-auto padding-bottom-auto padding-right-auto svelte-17zurke']}
kaliiiiiiiiii commented 10 months ago

@Deimmm haha tbh I didn't event test this one, only implemented it based on the documentation.

Anyways, thanks for submitting this issue l'll fix it in the next release

kaliiiiiiiiii commented 10 months ago

@Deimmm feel free to report in case this doesn't resolve your issue