WiktionaryParser
WiktionaryParser copied to clipboard
Missing pronunciations in Chinese
Links to pronunciation audio files are not returned when searching for Chinese words (using Han characters). For example the following code:
word = parser.fetch('朋友', 'chinese')
for item in word:
print(item['pronunciations'])
returns
{'text': ['朋友\n', '朋友\n'], 'audio': []}
This appears to be because pronunciations for Chinese words are placed inside
<div class="vsSwitcher" data-toggle-category="pronunciations"></div>
whereas those for English are in
<table class="audiotable"></table>
This may be related to #9
@claw89 thank you for pointing this out and debugging! I'm not working on this parser atm so can't really fix this right now but, a pull request for this would be helpful