Re: get css selector of focused element

Andy B.

I never figured out how to get it to work inside of an NVDA addon either. You could try bs4, cssutils, or tinycss. Unfortunately, they all require xml.dom. NVDA excluded it from its Python library for some strange reason, and providing a prebuilt version of xml.etree seems impossible. If you can figure it out, I can continue work on developer toolkit.



From: <> On Behalf Of Stefan Moisei via
Sent: Tuesday, November 17, 2020 4:58 PM
Subject: [nvda-addons] get css selector of focused element



Is it possible to get a css selector for the focused web element?   I tried IA2 attribeutes and iSimpleDomNode, but I only managed to get the class and id. this is not enough, since web devs hardly respect the rule of unique ID’s.

Doing it with js is not reliable either, as, even with nvda+8 turned  off, focus is not always correctly found.



Join to automatically receive all group messages.