According to this question I want find an element in my JavaScript code by some thing like this:
IJavaScriptExecutor js = (IJavaScriptExecutor)driver;
string count =
js.ExecuteScript(
"return document.querySelectorAll('ul.tag-list > li.tag-item').length")
.ToString();
And It works correctly. But I need run my JavaScript code in the special piece of the page not the whole of a document. Is it anyway?