What you get back from that URL is a full HTML page so I think you will need to bring in a HTML parser. I guess that you are looking to get at the actual image file and this is how you could get the URL for that using HTML::TreeBuilder::XPath
use HTML::TreeBuilder::XPath; # ... for my $count ( 0 .. 417 ) { my $url = "http://crappyfartsgohome.wikia.com/wiki/File:".$myFileN +ame[$count]; my $request = HTTP::Request->new(GET => $url); my $response = $browser->request($request); if ($response->is_error()) {print $response->status_line, "\n";} my $contents = $response->content(); my $tree = HTML::TreeBuilder::XPath->new; $tree->parse($contents); $tree->eof; my @links = $tree->findnodes('//div[@class="fullImageLink"]/a'); my $image_link = $links[0]; my $image_url = $image_link->attr('href'); print "$myFileName[$count]\n$image_url\n\n"; next if $image_url =~ m/$reject1/; next if $image_url =~ m/$reject2/; # do stuff with image URL }
OUTPUT:
Kniro-Lippies V.6 Concept.JPG http://vignette2.wikia.nocookie.net/crappyfartsgohome/images/b/b3/Knir +o-Lippies_V.6_Concept.JPG/revision/latest?cb=20140714143948 Kniro concept thing.png http://vignette3.wikia.nocookie.net/crappyfartsgohome/images/4/43/Knir +o_concept_thing.png/revision/latest?cb=20140714143947 Kniro og.png http://vignette3.wikia.nocookie.net/crappyfartsgohome/images/3/3e/Knir +o_og.png/revision/latest?cb=20140714143946
Note that I changed $reject1 to 'OKAY_I_SERIOUSLY_CANNOT.png'

In reply to Re: I keep getting "b/bc/Wiki.png" instead of the actual thing I want by tangent
in thread I keep getting "b/bc/Wiki.png" instead of the actual thing I want by Nyro46

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.