Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

AttributeError: 'NoneType' object has no attribute 'text' when using parse_pubmed_caption #150

Open
qm-intel opened this issue Aug 11, 2024 · 1 comment
Labels

Comments

@qm-intel
Copy link

qm-intel commented Aug 11, 2024

@Michael-E-Rose @titipata Thanks for your tool.

When I am using parse_pubmed_caption() from Pubmed Parser for the document that I have attached here

rna-9-860.zip

I am getting the following error:

File "/home/user/myprojects/1-parse-xml-image-caption-inline.py", line 79, in <module>
    caption_dict = pp.parse_pubmed_caption(xml_file_path[0])  # dict_keys(['pmid', 'pmc', 'fig_caption', 'fig_id', 'fig_label', 'graphic_ref'])
  File "/home/user/anaconda3/envs/medline/lib/python3.10/site-packages/pubmed_parser/pubmed_oa_parser.py", line 427, in parse_pubmed_caption
    fig_label = stringify_children(fig.find("label"))
  File "/home/user/anaconda3/envs/medline/lib/python3.10/site-packages/pubmed_parser/utils.py", line 51, in stringify_children
    [node.text]
AttributeError: 'NoneType' object has no attribute 'text'

How to resolve this issue?

@qm-intel qm-intel added the bug label Aug 11, 2024
@Michael-E-Rose
Copy link
Collaborator

We need the code that let to this error. Otherwise we cannot replicate it.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants