Questions tagged [pywikibot]

Pywikibot is a Python library to access the MediaWiki API.

Pywikibot

Pywikibot is a library to access the MediaWiki API. Its former name was .

Useful links

119 questions
0
votes
2 answers

Getting auto value for some Infobox attributes

I am using pywikibot api to fetch Wikipedia Infobox attributes. Few things I want to extract is population denisty, population, elevation etc. For some of the cities e.g(https://en.wikipedia.org/wiki/Beijing), the api is returning "auto" as value…
Ankit Agarwal
  • 166
  • 1
  • 1
  • 11
0
votes
1 answer

Create a page using Pywikibot

I am trying to create a page in https://dev.wikidebates.org/wiki/Wikidébats:Accueil, it is similar ti wikipedia, so Pywikibot should work the same way. I would like to make a page using Pywikibot. I checked option scripts in Pywikibot…
0
votes
1 answer

Script returns No user is logged in on site in Pywikibot 7.2.0

Recently I decided to update Pywikibot to version 7 since the legacy API had been deprecated in Fandom wiki. Far from solving the issue, I ended up bashing my head with "No user is logged in" error instead. I had user-config.py and the credentials…
0
votes
2 answers

How to add space in python's search/find string?

I have been running a pywikibot on Marathi wikipedia since almost a month now. The only task of this bot is find and replace. You can find overall details of pywikibot at: pywikibot. You can find the details of that particular find and replace…
0
votes
1 answer

Wikipedia Library shows error if input not given exactly to the name of a page of wikipedia

If I give a voice command using speech recognition module to search something in Wikipedia if I don't say exactly it shows an error. For example: I say(National Defence Academy) no Wikipedia page is named so but(National Defence Academy (India)) is…
0
votes
1 answer

How to find subcategories and subpages on wikipedia using pywikibot?

i would like to get all (87) subcategories and all pages (200) in the "Pages in category "Masculine given names"" section on this site: https://en.wikipedia.org/wiki/Category:Masculine_given_names I tried it with the following code: import…
Rapid1898
  • 895
  • 1
  • 10
  • 32
0
votes
1 answer

Get all names from wikipedia-site?

i try to extract all names from this site - https://en.wikipedia.org/wiki/Category:Masculine_given_names (and i want to have all names which are listed on this site and the following pages - but also the subcategories which are listed at the top…
Rapid1898
  • 895
  • 1
  • 10
  • 32
0
votes
1 answer

pywikibot.exceptions.TimeoutError - how to modify the default

in my github actions unit test i am running some pywikibot code (pywikibot 6.6.3) that some times fails due to the site not being responsive or a misconfiguration. The log report used to show the error messages after a few minutes. Now the code runs…
Wolfgang Fahl
  • 15,016
  • 11
  • 93
  • 186
0
votes
1 answer

How to get the contributors you've coincided editing the most in Wikipedia

I'm doing a gamification web app to help Wikimedia's community health. I want to find what editors have edited the same pages as 'Jake' the most in the last week or 100 last edits or something like that. I know my query, but I can't figure out what…
Destokado
  • 53
  • 1
  • 7
0
votes
2 answers

Get links from summary section of wikipedia page

I am trying to extract links from the summary section of a wikipedia page. I tried the below methods : This url extracts all the links of the Deep learning page: https://en.wikipedia.org/w/api.php?action=query&prop=links&titles=Deep%20learning And…
Sumanth
  • 497
  • 4
  • 12
0
votes
1 answer

Pywikibot - Find the source site of page image

I go through the living people category on wikipedia and I collect page images,. The problem is, some images are stored on the wikimedia commons site, whereas some are stored on the original wikipedia:en site. I want to know where the image is…
Welsy
  • 77
  • 11
0
votes
1 answer

What is MediaWiki's default EventStream endpoint?

I'm setting up a MediaWiki based website locally. It's running with Apache on localhost. I'd like to set up some scripts to consume my wiki's event stream. MediaTech has docs that show examples like this: import json from sseclient import SSEClient…
Cyrus
  • 613
  • 1
  • 6
  • 22
0
votes
1 answer

Wikipedia revision history using pywikibot: size of revision (follow-up)

I would like to follow up on this thread: Wikipedia revision history using pywikibot I'm trying to get the "size of revision" (number of bytes changed) variable for my list of Wikipedia page revisions with pywikibot 5.2.0, but don't find the…
0
votes
1 answer

How to iterate over a CSV file with Pywikibot

I wanted to try uploading a series of items to test.wikidata, creating the item and then adding a statement of inception P571. The csv file sometimes has a date value, sometimes not. When no date value is given, I want to write out a placeholder…
kylemaxim
  • 95
  • 5
0
votes
2 answers

Can't run any scripts in pywikibot

I am trying to use pywikibot, but I can't any script of the scripts. They all return the same error message: python3 .\pwb.py .\scripts\listpages.py ERROR: Unable to execute script because no generator was defined. Use -help for further…
Muhammad Azeez
  • 926
  • 8
  • 18