I am having difficulties parallelizing that part of code where new_text is of type unicode:
for old, new in self.replacements:
line = pywikibot.replaceExcept(
line, old, new, self.excsInside, self.site)
if new_text != entry.text:
…
I'm writing a bot for Wikipedia but have a problem. When I want to get stuff from another Wikimedia site I get the error - error-name 'wikiquote' is not defined.
This is when I start the code off like this-
import wikipedia
site =…
I know a single category can be moved by using like this:
python pwb.py category move -from:Apple -to:Banana
But, I can't find the way to move mass categories in just one command.
Is there any options like -pairsfile in movepages.py? It would be…
I am trying to create a wiki data SPARQL query. What I want to do is to get multiple items from the some property
For example:
I am trying to fetch all data that have property of instance of statistical packages.
But the problem I am facing is for…
I have a list of strings called cities, where each string is a city name that is also the title of a wikipedia page. For each city, I'm getting the wikipedia page and then looking at the text content of it:
cities = [(n["name"]) for n in…
I am trying to get a list of all of Kurt Cobain's quotes from the mediawiki api. I have:
https://en.wikiquote.org/w/api.php?format=json&action=query&srsearch=Kurt+Cobain&list=search
BUT, it doesn't seem to give me any of his quotes as shown…
I want to collect all the revisions history data at once.
Pywikibot page.revisions() does not have the parameter to fetch number of bytes changed.
It gives me all the data that I need except the number of bytes changed.
How do I get the number of…
Given a Wikipedia user/editor id and a timeframe, is there a way in Python to get details about all the contributions/edits made the user/editor? I want to fetch details like page edited, action taken, bytes added/deleted in case of revision, and…
I'm creating a semi-automated tool in Python, using pywikibot, to import data from TOP500 database into Wikidata, following this and this tutorial. (Is my first time programming in Python).
It ran fine, until the script attempts to commit a numeric…
I would like my pywikibot to remove
| name = whatever
from a wikipedia infobox if the name is equal to the title of the page using the replace function. Is there an easy way to do that?
The code to use should be something like that:
$ python pwb.py…
I'm trying to get plain(without html/css/special characters/ characters like \n/links/images) text of section using wikipedia api.
I trying to do that with this code
import requests
API_URL = 'http://en.wikipedia.org/w/api.php'
def…
I have this piece of code that find all the wikipedia articles that have the template dubious using the library pywikibot:
pages = pywikibot.Page(site, "Template:Dubious").getReferences(namespaces = 0)
Now I need to find all Featured articles. I…
I'm building a model to classify raw Wikipedia text by article quality (Wikipedia has a dataset of ~30,000 hand-graded articles and their corresponding quality grades.). Nonetheless, I am trying to figure out a way to algorithmically count the…
I recently learned how to scrape my mom's recipes from a cooking website. My current goal is to put those recipes into a self-hosted mediawiki server. Since all I know is python, I'm trying to use GET and POST requests and the API to create these…
I am trying to fill-up page numbers of a Book in its Index Wikisource page. The following code writes well in the specific pageNumber parameter.
If the page is empty, it looks fine. But if i run the code another time, due to the concatenation the…