Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the WWW-Mechanize CPAN distribution.

Report information
The Basics
Id: 2654
Status: resolved
Priority: 0/
Queue: WWW-Mechanize

People
Owner: Nobody in particular
Requestors: joe [...] confucius.gnacademy.org
Cc:
AdminCc:

Bug Information
Severity: Wishlist
Broken in: 0.41
Fixed in: 0.41



Subject: Add method to get a simple list of urls
I'd like to code a routine $agent->get_abs_hrefs(qr/test/); Which gets a list of hrefs with matching the regex test, the hrefs would also be absolute hrefs. Before I code this, let me know if anyone would find it useful and if there are any suggestions on the calling arguments.
Show quoted text
> $agent->get_abs_hrefs(qr/test/); > > Which gets a list of hrefs with matching the regex test, the hrefs > would > also be absolute hrefs.
What's wrong with $agent->find_link( text_regex => qr/test/i ); Am I missing something?
Maybe I'm missing something. find_link only gets one link. I'm looking for a routine that would gets a list of all links on a page that match a regex. The application is a harvester program that gets course information from an online catalog. I want to download all of the links that match a regex. Maybe the routine should be called $agent->find_links(text_regex=>qr/test/); [PETDANCE - Mon May 26 21:45:28 2003]: Show quoted text
> > $agent->get_abs_hrefs(qr/test/); > > > > Which gets a list of hrefs with matching the regex test, the hrefs > > would > > also be absolute hrefs.
> > What's wrong with > > $agent->find_link( text_regex => qr/test/i ); > > Am I missing something? > >
Show quoted text
> Maybe I'm missing something. find_link only gets one link. > I'm looking for a routine that would gets a list of all > links on a page that match a regex.
The links() method returns all links.