Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling

Re: Negate link search in Mechanize

by Plankton (Vicar)
on Nov 02, 2011 at 05:04 UTC ( #935293=note: print w/replies, xml ) Need Help??

in reply to Negate link search in Mechanize

Why not just get all the links like so ...
... use WWW::Mechanize; my $mech = WWW::Mechanize->new(); $mech->get( $url ); my @links = $mech->links();
... then iterate over @links. Something like ...
for my $l (@links) { next if $l->url() =~ /foo/; push ( @non_foo_links, $l ); ...

Replies are listed 'Best First'.
Re^2: Negate link search in Mechanize
by Anonymous Monk on Nov 02, 2011 at 05:18 UTC
    Why not just get all the links like so ...

    Because I'm lazy (a Perl virtue, you know). But thanks, I was too focused on letting Mechanize do the work and did overlook the obvious. Maybe time to get some sleep.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://935293]
[Corion]: Your Mother: Aah - Server Side Events maybe, which mostly sends events from the server as they come up?
[Your Mother]: Sounds right.
[Corion]: Your Mother: I think that that is basically the origin story. Flat earth started as trolling, but then the real believers drove out the trolls
LanX is pretty brown in summer
[Your Mother]: Though a bad match for the OP in question here. :P
[Corion]: Your Mother: Yeah
[Your Mother]: Americans are still pumping out video games where you get to slaughter as many Germans as you have the GPU for... It has always struck me as odd that this particular case seems fine to people. :\
[LanX]: yep heard the same origin story
[Your Mother]: I like it. I tottered on going into hucksterism because I feel like the world deserves it.
[LanX]: he ... we have a movement here called Anti-Germans based on this

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (18)
As of 2018-03-19 13:39 GMT
Find Nodes?
    Voting Booth?
    When I think of a mole I think of:

    Results (240 votes). Check out past polls.