I have a piece of html code where I have to remove the hidden elements from it. I tried the following code
from pyquery import PyQuery
html_data = '''
<div style="display: none;">This is a hidden div.</div>
<p>This is another paragraph.</p>
<span style="display: none;">This is a span</span>
<div>This is a div.</div>
'''
pq = PyQuery(html_data)
pq(':hidden').remove()
pq.html()
pq.remove(':hidden')
pq.html()
This is not removing the hidden elements. Any idea how to remove those hidden elements