View Single Post
Old 01-06-2024, 11:11 AM   #2
Villard
Connoisseur
Villard began at the beginning.
 
Posts: 74
Karma: 10
Join Date: May 2016
Device: Koreader running on Kobo Libra 2
I've found this way to solve my question :
for partners in soup.find_all('section', {'class': "content-partners"}):
for partnersTC in partners.find_all('p'):
if 'partners">' in str(partnersTC):
partnersTC.decompose()

I do not use the 'a' tag and its 'href' attribute. Instead I test if the text 'partners">' is present.
There may have a better and proper way to achieve it. Thank you for your input

Villard

Last edited by Villard; 01-06-2024 at 11:18 AM.
Villard is offline   Reply With Quote