elements = soup.find_all('tp:treatment-sec', attrs={'sec-type': 'Description'})
if len(elements) == 0:
elements = soup.find_all('tp:treatment-sec', attrs={'sec-type': 'description'})
In the first paper, 1 extra element is retrieved. This element does not have a corresponding Figure to write intooutput_file. This is further shown via:
len(elements)
#Returns 46
but there are 45 botanic illustrations in its output_file. This may happen in other papers as well.
Following code gather extra description data.
In the first paper, 1 extra element is retrieved. This element does not have a corresponding Figure to write into
output_file
. This is further shown via:but there are 45 botanic illustrations in its
output_file
. This may happen in other papers as well.