adapter_deviantartcom: Add another way to remove comments section.

This commit is contained in:
Jim Miller 2024-03-10 16:14:14 -05:00
parent bd41796231
commit cf28bc26f0

View file

@ -226,6 +226,12 @@ class DeviantArtComSiteAdapter(BaseSiteAdapter):
comments = soup.select_one('[data-hook=comments_thread]')
if comments:
comments.decompose()
# previous search not always found in some stories.
# <div id="comments"></div> inside the real containing
# div seems more common
commentsdiv = soup.select_one('div#comments')
if commentsdiv:
commentsdiv.parent.decompose()
content = soup.select_one('[data-id=rich-content-viewer]')
if content is None: