Script to replace HTML elements by ID or class in lots of HTML files
after a website mirrored u开发者_运维知识库sing HTTrack, there is lots of ads. I just want to replace that ads by ID or class, or by text, using script (Perl, Python, Ruby, etc), or any other way
Does anyone know what script can do this job?
Thanks in advance.
--new added below--
I will use as example in presentation, and replace specific ID or class with my own content (replace all in div class="message"
)
<div class="message">Examples here</div>
Some website even don't use ID and class (it use table instead). So it will be better if I can replace by text (replace from start <table
to end </table>
)
<table width="890" border="0" cellpadding="0" cellspacing="0"
style="margin-top:1px;background-color:#606060;border-bottom:1px solid black">
<tr style="heigh...
I need this too.. javascript is not really flexible... especially if you need to exclude some part of your old static HTML website when exporting to modern web framework.
some people told me to use perl linux command... but after some searching, i found nothing about this kind of replacing.
精彩评论