File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed
astropylibrarian/reducers Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -349,11 +349,14 @@ def process_html(self, html_page: HtmlPage) -> None:
349349 image_elements = doc .cssselect ("img" )
350350 logger .debug (f"Found { len (image_elements )} image elements" )
351351 for image_element in image_elements :
352- img_src = image_element .attrib ["src" ]
353- if img_src .startswith ("data:" ):
354- # skip embedded images
355- continue
356- self ._images .append (urljoin (self .url , img_src ))
352+ img_src = image_element .attrib .get ("src" )
353+ if img_src is not None :
354+ if img_src .startswith ("data:" ):
355+ # skip embedded images
356+ continue
357+ self ._images .append (urljoin (self .url , img_src ))
358+ else :
359+ logger .debug (f"Image element { image_element } missing attribute 'src'" )
357360
358361 root_section = doc .cssselect ("section" )[0 ]
359362 for s in iter_sphinx_sections (
You can’t perform that action at this time.
0 commit comments