Is there a reflow / layout library for Ruby / Python HTML?

I am looking for a library in Ruby or Python that will take some HTML and CSS as input and return data that contains the positions and sizes of the elements. If this helps, I do not need information for all elements except the main sections of the page.

+3
source share
2 answers

Scriptor, I think that you are probably looking, maybe something in JavaScript is more than Ruby or Python. I mean that the positions and sizes will essentially be determined by the rendering engine (browser). You can use something like jQuery to scroll through all your desired objects - display the name of the object (for example, the DIV identifier) ​​and the height and width of this element. So, for what it's worth, I would look at jQuery if I were in your position and the methods of height () and width (). You never know - there may already be a jQuery plugin.

+3
source

Ruby Python Regex. , /width =\ "(\ d +) px \" //height: (\ d +) px/. $1, . , , , . , bsperlinus

-1

All Articles