titipata/pubmed_parser

AttributeError: 'NoneType' object has no attribute 'find'

JIBINJOHNV opened this issue · 2 comments

I was using paragraph-level parsing. Unfortunately, it was showing some errors. Could you please look into it.

#Commanf used 
dicts_out2 = pp.parse_pubmed_paragraph('pubmed22n0001.xml', all_paragraph=False)

Error observed:
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/jibin/.local/lib/python3.8/site-packages/pubmed_parser/pubmed_oa_parser.py", line 353, in parse_pubmed_paragraph
    dict_article_meta = parse_article_meta(tree)
  File "/home/jibin/.local/lib/python3.8/site-packages/pubmed_parser/pubmed_oa_parser.py", line 69, in parse_article_meta
    pmid_node = article_meta.find('article-id[@pub-id-type="pmid"]')
AttributeError: 'NoneType' object has no attribute 'find'

Hi @JIBINJOHNV I made a PR in #116 and merge it. Let me know if it fixes your issue. If not, I can reopen this issue.

Now it is working fine and thank you for fixing the issue.