skip to Main Content

I am trying to setup a Telegram Instant View for a website.
this website has a lot of empty

tags that i don’t know how to remove them.

<p style="text-align: justify;">    &nbsp;</p>

i want to find a way to remove and get rid of these kind of

tags

2

Answers


  1. I found it Ehasn:

    First replace all ” ” content with sample string like “null-tag” the remove them using this code:

    @replace("u00a0", "null-tag"): //p
    @remove: //p[.="null-tag"]
    

    Note that it might change some contents check some pages to make sure it work fine for you.

    Login or Signup to reply.
  2. If you want to remove &nbsp; just use @replace function:

    @replace("u00a0", ""): //nodes/text()
    

    If you want to remove tags with spaces, call @remove and pass a predicate, that selects empty nodes after space normalization.

    @remove: //nodes[not(  normalize-space(text())  )]
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search