Skip to content

Always Returns Empty JSON #112

Description

@python-bear

Running the following code:

from wiktionaryparser import WiktionaryParser


parser = WiktionaryParser()

word = parser.fetch("word")
print(word)

for any word always returns [{'etymology': '', 'definitions': [], 'pronunciations': {'text': [], 'audio': []}}]

Activity

  1. ruoxining commented on Feb 26, 2026

    @ruoxining

    My debugging output indicates that the API request is blocked by the Wikipedia Robot policy.

    In [1]: self.soup
    Out[1]: Please set a user-agent and respect our robot policy https://w.wiki/4wJS. See also https://phabricator.wikimedia.org/T400119.

    These pages suggest adding a User Agent header instead of mocking a browser.

    Further, the Wiktionary HTML architecture seems to have changed from what is expected by the code. Now the domains are put in 'div's, no longer 'span's.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions