假设我希望 each<tr>
成为一个对象,其子<td>
项成为该对象的字段。所以我正在寻找这样的东西:
getListFromTable :: Window -> Element -> [Thing]
getListFromTable w table = do
rows <- getElementsByClassName w "thing-row"
-- BS starts here, lets say fromFields creates a Thing from ... fields.
attrList = [ fromFields [ r # get UI.children ] | r <- rows ]
return attrList
但是,我似乎无法正确选择类型,而且我想我什至不知道什么get UI.children
是正确的,因为它不像给我一个像 [Element] 这样的明显类型。