File tree Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -321,14 +321,22 @@ def remove_google_analytics(html):
321
321
el .getparent ().remove (el )
322
322
323
323
324
- # remove Carbon ads
324
+ # remove ads
325
325
def remove_ads (html ):
326
+ # Carbon Ads
326
327
for el in html .xpath ('//script[@src]' ):
327
328
if 'carbonads.com/carbon.js' in el .get ('src' ):
328
329
el .getparent ().remove (el )
329
330
for el in html .xpath ('/html/body/style' ):
330
331
if el .text is not None and '#carbonads' in el .text :
331
332
el .getparent ().remove (el )
333
+ # BuySellAds
334
+ for el in html .xpath ('//script[@type]' ):
335
+ if 'buysellads.com' in el .text :
336
+ el .getparent ().remove (el )
337
+ for el in html .xpath ('//div[@id]' ):
338
+ if el .get ('id' ).startswith ('bsap_' ):
339
+ el .getparent ().remove (el )
332
340
333
341
334
342
# remove links to file info pages (e.g. on images)
Original file line number Diff line number Diff line change 17
17
# You should have received a copy of the GNU General Public License
18
18
# along with this program. If not, see http://www.gnu.org/licenses/.
19
19
20
- from commands import preprocess
21
20
import argparse
22
21
import concurrent .futures
23
22
import os
24
23
import shutil
24
+ from commands import preprocess
25
25
26
26
27
27
def main ():
Original file line number Diff line number Diff line change 24
24
import contextlib
25
25
import unittest
26
26
import unittest .mock
27
+ from lxml import etree
27
28
from commands .preprocess import build_rename_map
28
29
from commands .preprocess import convert_loader_name
29
30
from commands .preprocess import has_class
38
39
from commands .preprocess import transform_ranges_placeholder
39
40
from commands .preprocess import trasform_relative_link
40
41
from commands .preprocess import rename_files
41
- from lxml import etree
42
42
43
43
44
44
class DummyFile (object ):
Original file line number Diff line number Diff line change 17
17
18
18
import os
19
19
import unittest
20
+ from lxml import etree
20
21
from commands .preprocess_cssless import preprocess_html_merge_cssless
21
22
from commands .preprocess_cssless import silence_cssutils_warnings
22
23
from commands .preprocess_cssless import convert_span_tables_to_tr_td
26
27
from commands .preprocess_cssless import convert_font_size_property_to_pt
27
28
from commands .preprocess_cssless \
28
29
import convert_table_border_top_to_tr_background
29
- from lxml import etree
30
30
31
31
32
32
class TestPreprocessHtmlMergeCss (unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments