On Saturday 24 June 2006 22:35, Benji York wrote:
> > I would also like to think much harder about a good set of HTML
> > analyzing tools; this function was supposed to be a start in the
> > right direction, but I never got around thinking harder about it.
> Which function is "this function"?
analyze.queryHTML() in the referenced SchoolTool code. I think some
higher-level functions would be desirable, like: "Get text of the specified
tag." or "Ensure that no links are broken." The latter is particularly useful
when checking for security. But all of this should be an additional API on
top of testbrowser of course. I think the following would be cool:
'Title of Page'
Often I also have results of the sort:
<div style="font-size: 60%">
by <span class="grantor">SchoolTool Manager</span>
on <span class="date">...</span>
<div class="description">A job well done.</div>
Then I would like something like this to work:
>>> print Analyzer(browser).getTextOnly('//[EMAIL PROTECTED]"commendation"]')
by SchoolTool Manager on ...
A job well done.
All I want to ensure is that the right text is shown together. I do not care
whether this commendation is the first, n-th or last commendation in the
In other scenarios I specifically want to test for order only:
... '//[EMAIL PROTECTED]"commendation"]/h3')
['Good job!', 'Well Done', 'Fantastic']
As I said, I have not thought too hard about a specific API recommendation
yet, but I believe I have enough experience now to think about it now.
CBU Physics & Chemistry (B.S.) / Tufts Physics (Ph.D. student)
Web2k - Web Software Design, Development and Training
Zope3-dev mailing list