Skip to content
This repository has been archived by the owner on Jan 3, 2024. It is now read-only.

Seems a bug when cope with the word phone number #83

Open
littlefive5 opened this issue Mar 18, 2021 · 1 comment
Open

Seems a bug when cope with the word phone number #83

littlefive5 opened this issue Mar 18, 2021 · 1 comment
Assignees
Labels

Comments

@littlefive5
Copy link

littlefive5 commented Mar 18, 2021

definitions = parser.fetch("phone number")
`AttributeError                            Traceback (most recent call last)
<ipython-input-35-f004712ed494> in <module>
----> 1 definitions = parser.fetch("phone number")

C:\ProgramData\Anaconda3\lib\site-packages\wiktionaryparser.py in fetch(self, word, language)
    258         self.current_word = word
    259         self.clean_html()
--> 260         return self.get_word_data(language.lower())

C:\ProgramData\Anaconda3\lib\site-packages\wiktionaryparser.py in get_word_data(self, language)
    115             'definitions': self.parse_definitions(word_contents),
    116             'etymologies': self.parse_etymologies(word_contents),
--> 117             'related': self.parse_related_words(word_contents),
    118             'pronunciations': self.parse_pronunciations(word_contents),
    119         }

C:\ProgramData\Anaconda3\lib\site-packages\wiktionaryparser.py in parse_related_words(self, word_contents)
    219             span_tag = self.soup.find_all('span', {'id': related_id})[0]
    220             parent_tag = span_tag.parent
--> 221             while not parent_tag.find_all('li'):
    222                 parent_tag = parent_tag.find_next_sibling()
    223             for list_tag in parent_tag.find_all('li'):

AttributeError: 'NoneType' object has no attribute 'find_all'`
@suyashb95 suyashb95 self-assigned this Mar 18, 2021
@suyashb95 suyashb95 added the bug label Mar 18, 2021
@suyashb95
Copy link
Owner

suyashb95 commented Mar 18, 2021

@littlefive5 Thanks for reporting this! Feel free to submit a PR for this if you have a fix, I'm not actively working on this project currently but, will be able to pick it up later

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants