Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

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

by johncoswell (Acolyte)
on Apr 27, 2000 at 18:01 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://9399]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (5)
As of 2024-03-29 00:01 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found