CSS query generation APIs

半世苍凉 提交于 2019-12-25 05:25:09

问题


I have had enough search on this topic and could not find a suitable answer, finally my question is Does any one know any APIs which I can use to generate CSS query from the web page, similar to the Xpath we get it from Mozilla or chrome plugins.

attached is the image for reference.

On the similar lines of this image, I need API for CSSQuery which gives me CSS query for selected element


回答1:


Are you looking for something like document.querySelector, document.querySelectorAll (and their counterparts for Element)?




回答2:


I finally wrote my own code which generates a perfect css query :-)




回答3:


Atlast the CopyCssPath is implemented by Chrome



来源:https://stackoverflow.com/questions/17292794/css-query-generation-apis

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!