#1600 Removing html chunk

open
Fabian Keil
filters (151)
5
2013-10-30
2013-10-30
Anonymous
No

I am not able to figure out how to use a Privoxy filter to remove a chunk of html code that comes in from a site that I continuously visit. The code is abbreviated as follows:

<div class="Primary Header" style="float: left;">Mixed Surface Analysis</div>
<div class="BreadCrumb"><a href= ...

... Global Weather
</a>
</div>
</td>
</tr>
</tbody></table>
</div>
</div>

Does anyone have an example of how to eliminate a chunk of html code from a site as it is being loaded in through Privoxy?

Thanks.

Discussion

  • Fabian Keil
    Fabian Keil
    2013-10-30

    • assigned_to: nobody --> fabiankeil
    • labels: --> filters
    • status: open --> pending
     
  • Fabian Keil
    Fabian Keil
    2013-10-30

    Please describe what you tried so far, so we can provide the missing pieces.

    Filter creation is supposed to be sufficiently documented, so if it isn't, we should change that.

    Having said that, you also might want to consider merely suppressing the display of this chunk instead of removing it completely. You could use the "google" or "yahoo" filters in default.action as example.

     
  • Anonymous
    Anonymous
    2013-10-30

    • status: pending --> open
     
  • Anonymous
    Anonymous
    2013-10-30

    Thanks. I'll look at the "google" or "yahoo" filters in default.action and see what I can figure out. I was looking in the wrong place.

     
  • Anonymous
    Anonymous
    2013-11-02

    Did get it to work. I think that an example of simply eliminating a chunk of code without the 'exact string' as in the '9.1. Filter File Tutorial - FILTER: js-annoyances' example.
    My string ended up like this, although I don't know if it is exactly right. It works anyway.
    user.action file:
    {+filter{wx-intellicast}}
    .intellicast.com.
    user.filter file:
    s/(<div id="toolbar">.*)(.*your area.)//Usg

    One question. Is there any way to tell the filter string to eliminate three additional lines past the (.*your area.)?

    Thanks