Subject: | [#27129] request search by class / id |
Date: | Mon, 8 Oct 2007 11:23:02 -0300 |
To: | bug-WWW-Mechanize [...] rt.cpan.org |
From: | "Adriano Ferreira" <a.r.ferreira [...] gmail.com> |
Dear Andy,
Would you please consider the addition of search by id / class as the
original ticket requestor called for?
This will be useful for avoiding the need for fragile " n => <magic
Show quoted text
number> " when searching in certain page designs. The support for id /
class attributes can be justified as they are special with regard to
element identification and classification. Thus, it would be possible
to find a link like this
$mech->find_link( { id => 'the-xyz-link' } );
or
$mech->find_link( { class_regex => qr/ ^ xyz-link-by /x } );
The attached patch implements this support for id / class / id_regex /
class_regex for find_link and if you think it is good enough, I may
look the necessary and desirable bits to be added to find_image as
well.
Best regards,
Adriano Ferreira
P.S. The patch is against the last revision encountered at Google
Subversion repository.
Message body is not shown because sender requested not to inline it.