I have no experience with it, but you might want to look at
https://www.privoxy.org/ It's a non-caching proxy that has filtering capabilities.
It can also handle decoding HTTPS, so that may work as well.
Since the proxy has a filtering capability, it should be straight forward to create an XSLT script that can be used to eliminate stylesheet elements, script elements, any element that Lynx doesn't support (may as well strip those). You can also remove embedded style attributes from individual elements. (I don't know if Lynx has some CSS support or ignores it completely).
But, as an example, since <DIV> tags are essentially ignored without styling information, you could strip those as well (every little bit helps). What you may end up with is questionable (DIV tags are all over the place, but it's almost all for styling and placement purposes), but it's possible.
Here's a simple skeleton XSLT script:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- Identity transform template -->
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<!-- Template to match and remove unwanted elements (in this case, <div>), but preserve the children -->
<xsl:template match="div">
<xsl:apply-templates select="node()"/>
</xsl:template>
<!-- Template to match and replace one element with another, like, say, article with p (paragraph) -->
<xsl:template match="article">
<p>
<xsl:apply-templates select="node()"/>
</p>
</xsl:template>
<!-- Template to match and remove unwanted elements and their children (in this case, <script>) -->
<xsl:template match="script">
<!-- do nothing -->
</xsl:template>
<!-- Template to match the style attribute, and remove it from all elements. -->
<xsl:template match="@style"/>
</xsl:stylesheet>
I don't know how to configure the proxy, so I can't help there, but if you can get the filtering to work, that skeleton should give you a start. You can use the xsltproc program to run the xslt script. That's a common program either bundled or readily available from package managers.
Let us know what you find out!