开发者

find all pages on a site that use a particular selector

I need to modify properties of a selector(let's say #myList) that is used on few pages of website I'm working on. I want to make sure my changes won't ruin the design. Is there a tool that will generate a list of all pages on a website that uses a particular selector? (I don't know on which pages selector is used. The site has too many 开发者_JAVA技巧pages so doing it manually won't work.)


I have built a command line tool called Element Finder which lets you enter in a CSS selector, like "#myList", and then searches through the directory and finds all of the HTML files with elements matching that selector.

You will need to install Element Finder, cd into the directory you want to search, and then run:

elfinder -s "#myList"

Or:

elfinder -s "#foo > .bar p > td .baz" 

For more info please see http://keegan.st/2012/06/03/find-in-files-with-css-selectors/


find /path/to/your/project -name '*.html' -exec grep -l 'id="myList"' {} \;

Of course, change the path and/or extension to suit your needs.

Edit: I should also note that this method will only work for non-nested/advanced selectors. If you're trying to find elements matching #foo > .bar p > td .baz or something ridiculous, then the answer is probably no.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜