RE: How can I automate the removal of hard-coded banners from locallysaved web pages




perl -i -pe 's/offending_code//g' /path/to/*.html

|-----Original Message-----
|From: Orel Stringa [mailto:orel.stringa@xxxxxxxxx]
|Sent: Friday, April 29, 2005 5:21 PM
|To: beginners@xxxxxxxx
|Subject: How can I automate the removal of hard-coded banners from
|locallysaved web pages
|
|
|Hi,
|
|I sometime happen to save certain web pages of interest (tutorials,
|articles, etc)
|locally on my PC. Unfortunately, some of these pages do carry top and
|bottom banners
|which are displayed every time I open the page locally on my PC (while
|PC is hooked
|up to the Internet).
|
|I understand this is caused by the fact that the urls of these banners
|are called in the source code of concerned web pages every
|time the page is loaded.
|
|I came up with a simple regex to automate the finding and removal of
|"offending html code"
|on multiple source code files, but that requires opening and saving
|the source code in text files in advance. This is too much work when
|talking about hundreds of such web pages.
|
|Do you have some ideas how to use Perl to automate the opening of the
|source code
|on multiple files, removing the "offending code" and at the end saving
|the source code on each
|html page?
|
|Thank you,
|Orel
|
|--
|To unsubscribe, e-mail: beginners-unsubscribe@xxxxxxxx
|For additional commands, e-mail: beginners-help@xxxxxxxx
|<http://learn.perl.org/> <http://learn.perl.org/first-response>
|
|
|

*********************************************************
Disclaimer:

The contents of this E-mail (including the contents of the enclosure(s) or attachment(s) if any) are privileged and confidential material of MBT and should not be disclosed to, used by or copied in any manner by anyone other than the intended addressee(s). In case you are not the desired addressee, you should delete this message and/or re-direct it to the sender. The views expressed in this E-mail message (including the enclosure(s) or attachment(s) if any) are those of the individual sender, except where the sender expressly, and with authority, states them to be the views of MBT.

This e-mail message including attachment/(s), if any, is believed to be free of any virus. However, it is the responsibility of the recipient to ensure that it is virus free and MBT is not responsible for any loss or damage arising in any way from its use

*********************************************************
.



Relevant Pages

  • Re: developing tracking
    ... You can have an automated system (source code ... as to what the actual changes are, there's really no way to automate this ... ' MergeSingleWord "Customers" ... ' The above would use/create the templates in a dir called Customers ...
    (microsoft.public.access.formscoding)
  • Re: http post
    ... in the source code of the page. ... function FormLogin() ... > For the session that I need to automate I need to: ... > wait for the upload to complete ...
    (microsoft.public.fox.programmer.exchange)
  • Re: tcl talked badly (and high on reddit)
    ... have some large chunk of source code (tcllib, for example) and I want to ... You can automate it easily enough either using or ... using existing namespace features: ...
    (comp.lang.tcl)
  • automatic source code
    ... I ve a question concerning automatic generated source code. ... When I program the declarations of a class (and save it in a file ... myclass::afunction, the constructors, the destructors, copy ... Is there a way to automate this task? ...
    (comp.lang.cpp)