I have figured out how to use selenium to check if an element is displayed and get all the css rules applied to it.
I guess the text of tags in the same "block" are in the same "structure", probably by checking the "display" css rule. But I don't know which html tag creates the "container" type "structure". It seems the table tag creates the "table" type, and most tags are "text" type.
I could get all the css rules of an element but kindle previewer only uses a few rules on an element and it also change the rule type and value, for example, "padding-left: 1em;" is changed to
Code:
margin_left: {
value: 3.7039999961853027e0,
unit: percent
}
I hope the original rule could work so I don't have to guess how they compute this value...