Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

RE: Extract and modify IMG SRC tags in an HTML document.

by johncoswell (Acolyte)
on Apr 27, 2000 at 18:01 UTC ( #9399=note: print w/ replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    open FILE,"filename";
    read FILE,$file,100000;
    close FILE;
    
  2. or download this
    @lines = split(/\<IMG/,$file);
    
  3. or download this
    $newfile = shift @lines;
    
  4. or download this
    foreach $line (@lines) {
      $pos = index($line,'>');
    ...
      $tag =~ s/SRC\=\"(.*?)\"/SRC\=\"$newurls{$1}\"/gi;
      $newfile .= $tag . $restofline . "\n";
    }
    
  5. or download this
    print $newfile;
    

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://9399]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (9)
As of 2015-07-02 01:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (25 votes), past polls