pywikibot

Wikipedia revision history using pywikibot

会有一股神秘感。 提交于 2021-02-19 11:58:05
问题 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 bytes changed? for example: for the article Main Page the revision history is here: history screenshot My current code: import pywikibot site = pywikibot.Site("en", "wikipedia") page = pywikibot.Page(site, "Main_Page") revs = page.revisions() Showing

Wikipedia revision history using pywikibot

孤者浪人 提交于 2021-02-19 11:56:17
问题 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 bytes changed? for example: for the article Main Page the revision history is here: history screenshot My current code: import pywikibot site = pywikibot.Site("en", "wikipedia") page = pywikibot.Page(site, "Main_Page") revs = page.revisions() Showing

How to add something to edit summary when using Pywikibot?

淺唱寂寞╮ 提交于 2021-01-28 05:22:49
问题 I am using Pywikibot at this moment, to add a lot of files in a category, and the Edit summary looks like this: "Bot: Adding category Taken with Sony DSC-WX350)" I would like to add the text "using Pywikibot in automatic mode" How to do that? 回答1: pywikibot.save has a parameter summary 来源: https://stackoverflow.com/questions/47469124/how-to-add-something-to-edit-summary-when-using-pywikibot

Imports working with raw file, but not in IDLE

ε祈祈猫儿з 提交于 2019-12-20 05:21:44
问题 UPDATE 10 Secs later Fixed properly now, and thanks to JF and Gauden. UPDATE I have found a temporary fix by saving the IDLE file in the directory the other working file is in. (I would still like to know how to fix it entirely if I can.) That's not a permanant fix, so if you want to try and help make it work wherever the file is saved, feel free. This is the start of a python file: #!/usr/bin/python # -*- coding: utf-8 -*- import wikipedia import pagegenerators import sys import re import

Content of infobox of Wikipedia

不羁岁月 提交于 2019-12-17 19:05:02
问题 I need to get the content of an infobox of any movie. I know the name of the movie. One way is to get the complete content of a Wikipedia page and then parse it until I find {{Infobox and then get the content of the infobox. Is there any other way for the same using some API or parser? I am using Python and the pywikipediabot API. I am also familiar with the wikitools API. So instead of pywikipedia if someone has solution related to the wikitools API, please mention that as well. 回答1: Instead

How to speed up Pywikibot?

て烟熏妆下的殇ゞ 提交于 2019-12-05 21:15:48
问题 I've built some report tools using Pywikibot. As things are growing it now takes up to 2 hours to finish the reports so I'm looking to speed things up. Main ideas: Disable throttling, the script is read-only, so page.get(throttle=False) handles this Cache Direct database access Unfortunately I can't find much documentation about caching and db access. Only way seems to dive into the code, and well, there's limited information about database access in user-config.py . If there is any, where

How to speed up Pywikibot?

孤街醉人 提交于 2019-12-04 04:28:54
I've built some report tools using Pywikibot . As things are growing it now takes up to 2 hours to finish the reports so I'm looking to speed things up. Main ideas: Disable throttling, the script is read-only, so page.get(throttle=False) handles this Cache Direct database access Unfortunately I can't find much documentation about caching and db access. Only way seems to dive into the code, and well, there's limited information about database access in user-config.py . If there is any, where can I find good documentation about pywikibot caching and direct db access? And, are there other ways to

How to download images programmatically from Wikimedia Commons without registering for a Bot account?

那年仲夏 提交于 2019-12-03 12:27:55
问题 It seems like the only way to get approval for a Bot account is if it adds to or edits information already on Wikimedia. If you try to download any images, without a bot account, using some of the api libraries out there you get error messages instead of the images. Seems like they block anyone not coming in from a browser? Anyone else have any experience with this? Am I missing something here? 回答1: Try explaining exactly what you want to do? And what you've tried? What error message did you

How to download images programatically from Wikimedia Commons without registering for a Bot account?

主宰稳场 提交于 2019-12-03 02:00:32
It seems like the only way to get approval for a Bot account is if it adds to or edits information already on Wikimedia. If you try to download any images, without a bot account, using some of the api libraries out there you get error messages instead of the images. Seems like they block anyone not coming in from a browser? Anyone else have any experience with this? Am I missing something here? Try explaining exactly what you want to do? And what you've tried? What error message did you get? You're not very clear... What libraries have you tried? If you're not aggressive, there are no