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
1 answer

python3 : How to remove data inbetween two parameters of Mediawiki template

The following is the data from a Wikisource page;- {{:MediaWiki:Proofreadpage_index_template |Type=book |Title=மணி பல்லவம் 1 |Language=ta |Author=நா. பார்த்தசாரதி |Translator= |Illustrator= |Editor= |Volumes=5 |School= |Publisher=தமிழ்ப்…
info-farmer
  • 255
  • 3
  • 18
0
votes
0 answers

Python: differences in search for regex and replace via regex

I'm writing a small script for auto-correcting interwiki translation links with pywikibot. I look for the existing links and want to rewrite them in a standard format with links to all pages. The text I'm looking for looks either somewhat…
planetmaker
  • 5,884
  • 3
  • 28
  • 37
0
votes
0 answers

Is there a way to port a git history of markdown files to mediawiki or alternatively just port the file structure of markdown files to mediawiki?

Is there a way to port a git history of markdown files to mediawiki or alternatively just port the file structure of markdown files to mediawiki? I have a project that I have been documenting using git and markdown. The project has gotten…
0
votes
2 answers

How to import pywikibot?

I have installed pywikibot and set up the config as described in the instructions. However when I put "importpywikibot" at the top of my script it says "No module named pywikibot". Do I have to install pywikibot somewhere special? Thanks.
TechnTom
  • 9
  • 1
  • 4
0
votes
1 answer

How can I get wikipedia xml page including all information which I need?

I have enwiki-20110115-abstract.xml as the follwing in the image 1: enter image description here I have also enwiki-20110115-pages-articles.xml as the following image 2 : enter image description here What I need is the all information tags in the…
0
votes
1 answer

How to parse Wikipedia talk page content by contributor?

I am looking to parse the Wikipedia talk page (e.g., https://en.wikipedia.org/wiki/Talk:Elon_Musk). I would like to loop through texts by contributors/editors. Not sure how do I do it. For now, I have the following code: import pywikibot as…
SanMelkote
  • 228
  • 2
  • 12
0
votes
1 answer

How to get wikipedia out-links of an article in python?

I want to get the out-links of wikipedia articles. What I mean by out-linkes are the links in What links here section in wikipedia articles. For instance, consider the data mining wikipedia article. What links here section of this article is in:…
EmJ
  • 4,398
  • 9
  • 44
  • 105
0
votes
1 answer

Testing image uploads in Wikimedia Commons

I want to use pywikibot to upload a batch of images into Wikimedia Commons. However, when you add images in Commons, you can't easily delete them if you made a mistake. Is there a way to locally install Wikimedia Commons for validation and testing…
kolam
  • 731
  • 4
  • 17
0
votes
1 answer

Why does calling a scrapy spider from pywikibot give a ReactorNotRestartable error?

I am able to call a scrapy spider from another Python script using either CrawlerRunner or CrawlerProcess. But, when I try to call the same spider calling class from a pywikibot robot, I get a ReactorNotRestartable error. Why is this and how can I…
Scott
  • 1
  • 3
0
votes
1 answer

How to get the content in Talk pages of wikipedia in python

I am currently using the following code to obtain the page content of wikipedia. import pywikibot as pw page = pw.Page(pw.Site('en'), 'Forensic science') page.text However, it seems like the above code does not reaturn content in Talk pages of…
EmJ
  • 4,398
  • 9
  • 44
  • 105
0
votes
1 answer

Printing the content of URLs in a text file, from a text file which contains a list of URLs in python

I have a text file which contains a list of URLs and I am willing to print the contents of the URL in another text file, along with the URL as the header. I have used this project file https://pypi.org/project/Wikipedia-API/ to extract the content,…
S_Chakra
  • 27
  • 1
  • 9
0
votes
3 answers

Python-Wikipedia Automated Downloader

[Using Python 3.1] Does anyone have any idea how to make a Python 3 application allow the user to write a text file with multiple words separated with commas. The program should read the file, and download the Wikipedia page of the requested item.…
Alex
  • 2,189
  • 3
  • 15
  • 9
0
votes
1 answer

pywikibot fails to upload large files

On a Google Compute Engine Server (Linux instance-1 4.9.0-6-amd64 #1 SMP Debian 4.9.88-1+deb9u1 (2018-05-07) x86_64 GNU/Linux), pywikibot fails to upload large files with the following error: pywikibot.data.api.APIError: missingparam: One of the…
0
votes
0 answers

String matching/searching for python

I'm attempting to scrape and clean wikipedia data. I have a data field that contains dimensions as shown below. ["112 x 76 yards (102.4m x 69.4m)", "104.5 x 70.3 m", "107m x 72m", "109×73 yds / 100×67 m", "{{convert|105|x|68|m|yd|1}}", "100…
MC101
  • 87
  • 5
0
votes
1 answer

How to delete a previous row while reading a row of a csv file by python3

I want to clean-up 12,000 wiki pages from this wiki category. For that, i am having all the 12,000 wikipages in a csv file. When my code runs, it modifies the page, one by one. How can i delete a previous row while reading a (next) row of a CSV file…
info-farmer
  • 255
  • 3
  • 18