Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

section_by_title with identical names returns info from the last one only #39

Closed
Pancho-mk opened this issue Jan 4, 2021 · 1 comment · Fixed by #57
Closed

section_by_title with identical names returns info from the last one only #39

Pancho-mk opened this issue Jan 4, 2021 · 1 comment · Fixed by #57

Comments

@Pancho-mk
Copy link

section_by_title(title: str)
In some pages with identical section names, like this one:
January in Events and January in Deaths in https://en.wikipedia.org/wiki/1920
returns the info from Deaths only.
Is there a way to associate the content of that specific name January with the main section Events?

@martin-majlis
Copy link
Owner

@Pancho-mk : You can use sections attribute of the page to get all sections. Then you can recursively check, whether the subsection has title Deaths.

https://github.com/martin-majlis/Wikipedia-API/blob/master/API.rst#wikipediapagesection

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

Successfully merging a pull request may close this issue.

2 participants