diff --git a/pubmed_parser/pubmed_oa_parser.py b/pubmed_parser/pubmed_oa_parser.py index d769d0d..97b47eb 100644 --- a/pubmed_parser/pubmed_oa_parser.py +++ b/pubmed_parser/pubmed_oa_parser.py @@ -156,7 +156,7 @@ def parse_pubmed_xml(path, include_path=False, nxml=False): journal_node = tree.findall(".//journal-title") if journal_node is not None: - journal = " ".join([j.text for j in journal_node]) + journal = " ".join(["".join(node.itertext()) for node in journal_node]) else: journal = "" diff --git a/tests/test_pubmed_oa_parser.py b/tests/test_pubmed_oa_parser.py index 4bff96e..bd17823 100644 --- a/tests/test_pubmed_oa_parser.py +++ b/tests/test_pubmed_oa_parser.py @@ -39,6 +39,7 @@ def test_parse_pubmed_xml(): assert parsed_xml.get("doi") == "10.1371/journal.pone.0046493" assert parsed_xml.get("subjects") == "Research Article; Biology; Biochemistry; Enzymes; Enzyme Metabolism; Lipids; Fatty Acids; Glycerides; Lipid Metabolism; Neutral Lipids; Metabolism; Lipid Metabolism; Proteins; Globular Proteins; Protein Classes; Recombinant Proteins; Biotechnology; Microbiology; Bacterial Pathogens; Bacteriology; Emerging Infectious Diseases; Host-Pathogen Interaction; Microbial Growth and Development; Microbial Metabolism; Microbial Pathogens; Microbial Physiology; Proteomics; Sequence Analysis; Spectrometric Identification of Proteins" # noqa assert "Competing Interests: " in parsed_xml.get("coi_statement") + assert parsed_xml.get("journal") == "PLoS ONE" def test_parse_pubmed_paragraph():