The algorithm for determining visually hidden HTMLDom elements

0 like 0 dislike
90 views
There is a task: code an html page programmatically determine the list of hidden (not visible to the eye) html elements.
The first thing that comes to mind: to take node.js + jquery (http://habrahabr.ru/blogs/javascript/104761/) and play with the pseudo-selector :visible, but there is no doubt that in this case will not be counted css files.

Question to experts: whether it is possible to teach this Suzaku to take into account css files and how to do it?

PS. I will also be grateful to other ways of solving the problem on linux.
by | 90 views

4 Answers

0 like 0 dislike
If breaks start on a server full browser view in the direction of Selenium. Had experience writing parsers/grabbers on it — has an API for almost any language (PHP).
Briefly about it: starts the browser and work directly with the already rendered in the browser page. So processed css and $('#element').hide() sorts.
Plus launch of "play view" is quite simple, that is not unimportant.
by
0 like 0 dislike
I would:
1. Had spars CSS for :hidden, output an array of styles for hiding elements.
2. Parsing HTML to include only the elements with :hidden and with a style from an array of CSS(p.1).
\r
Parsing already than whom it is more convenient +)
by
0 like 0 dislike
It is impossible in the framework of the task. Formulate the problem more specifically. Because of the width of the screen of the display device the visibility of objects holds. When I wrote the anti-spam for WordPress I standard entry form moved to 3000 pixels to the left, and not exposed :hidden, because some bots parse :hidden. From the point of view of the user is not visible neither. Another thing is if you need to find elements which never can be shown, that's a real challenge.
by
0 like 0 dislike
Can you?
offsetHeight == 0? hidden: visible
by

Related questions

0 like 0 dislike
2 answers
0 like 0 dislike
3 answers
0 like 0 dislike
3 answers
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
29,061 users