From: Marc G. <mgu...@ya...> - 2008-03-27 14:02:28
|
>>>would be able to generate "more intelligent" xpath expressions > > What is the logic? How to be intelligent? Any existing implementation > out there? I had this idea for the recorder, meaning with interaction with the user. I thought to 2 steps: 1- automatic: compute possible xpath expressions that are shorter than the canonical one, for instance by looking around targeted element (near parents, near children, near siblings) for some element with "something particular". Because a program is just stupid it can't understand which of the computed xpath make sense for the *current* user purpose, this is the reason why I wanted to propose a list of possible expressions 2- with "anchor" provided by the user you often need an xpath expression for a node relative to a particular node that make sense for your *current* purpose. The program can't really guess which is it, therefore I wanted to give the possibility to place an "anchor" on some element and use it to compute different xpath for the targeted node. Nevertheless such utilities makes more sense in an interactive tool like a firefox extension than in HtmlUnit. Cheers, Marc. -- Blog: http://mguillem.wordpress.com |