wikipedia

Query Wikipedia's API using AJAX (XMLHttpRequest)

泄露秘密 提交于 2019-12-18 02:48:10
问题 I am trying to implement a simple request to Wikipedia's API using AJAX (XMLHttpRequest). If I type the url in the address bar of Firefox, I get a neat XML, no sweat there. Yet, calling the exact same url with: // this is my XMLHttpRequest object httpObjectMain.open("GET", "http://en.wikipedia.org/w/api.php?action=query&format=xml&prop=langlinks&lllimit=500&titles=kaas", true); httpObjectMain.send(null); returns an empty response. According to FireBug, I get a 200 OK response, but the content

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

Fetch random excerpt from Wikipedia (Javascript, client-only)

妖精的绣舞 提交于 2019-12-17 16:49:44
问题 I have a web page that asks the user for a paragraph of text, then performs some operation on it. To demo it to lazy users, I'd like to add an "I feel lucky" button that will grab some random text from Wikipedia and populate the inputs. How can I use Javascript to fetch a sequence of text from a random Wikipedia article? I found some examples of fetching and parsing articles using the Wikipedia API, but they tend to be server side. I'm looking for a solution that runs entirely from the client

Scrape Data from Wikipedia

自古美人都是妖i 提交于 2019-12-14 03:48:54
问题 I am trying to find or build a web scraper that is able to go through and find every state/national park in the US along with their GPS coordinates and land area. I have looked into some frameworks like Scrapy and then I see there are some sites that are specifically for Wikipedia such as http://wiki.dbpedia.org/About. Is there any specific advantage to either one of these or would either one work better to load the information into an online database? 回答1: Let's suppose you want to parse

Get all page titles on Wikipedia that contain a specific word

假如想象 提交于 2019-12-14 03:27:57
问题 I am writing an "auto-wikifier" tool using HTML and JavaScript. For each word in the text to be wikified, I need to obtain a list of pages that contain that word (so that the matching phrases in the text can be automatically wikified, if they are found). Is there a way to obtain a list of all Wikipedia pages that contain a specific word, using one of Wikipedia's APIs or web services? function getMatchingPageTitles(theString){ //get a list of all matching page titles for a specific string,

Expand all categories of a Wikipedia category tree

Deadly 提交于 2019-12-14 02:43:18
问题 I am trying to do this via the Web Console (using Firefox, but I am willing to change if necessary of course). What I want to do is to basically click all the "plus" signs on a page at once. For an example see here: http://de.wikipedia.org/wiki/Kategorie:Volkswirtschaftslehre (excuse me for linking a german site, but the english wikipedia seems to be employing a different system now, and I need to do it on the German one...) This is how far I have gotten: When I enter var = document

python querying wikipedia performance

血红的双手。 提交于 2019-12-14 01:05:09
问题 I need to query wikipedia for just one very particular purpose, that is to to get the text for a given url. To be a little more precise: I have about 14.000 wikipedia urls of the english corpus and I need to get the text, or at least the introduction of each of these urls. My further processing will be in python, so this would be the language of choice. I am searching for the method with best performance and made up 4 different approaches: get the xml dump and parse directly via python ->

How to find all Wikipedia pages which are members two given categories using DBpedia?

。_饼干妹妹 提交于 2019-12-13 18:26:31
问题 I dabbled with DBpedia a couple of years ago and find it fascinating, but now that I want to perform a query after not using it for ages, I find it totally impenetrable. What SPARQL query should I issue to retrieve the set of all Wikipedia pages that are members of both "Category ABC" and "Category XYZ"? All of the examples I can find seem to be quite a bit more involved than my seemingly basic question, making it difficult to distil something minimal. (As an example I'd like to find all

what is a programming language?

ⅰ亾dé卋堺 提交于 2019-12-13 14:42:41
问题 Wikipedia says: A programming language is a machine-readable artificial language designed to express computations that can be performed by a machine, particularly a computer. Programming languages can be used to create programs that specify the behavior of a machine, to express algorithms precisely, or as a mode of human communication. But is this true? It occurred to me in the shower this morning that a programming language might just be a set of conventions, something that both a human and

Wikipedia Data Scraping with Python

為{幸葍}努か 提交于 2019-12-13 12:30:33
问题 I am trying to retrieve 3 columns (NFL Team, Player Name, College Team) from the following wikipedia page. I am new to python and have been trying to use beautifulsoup to get this done. I only need the columns that belong to QB's but I haven't even been able to get all the columns despite position. This is what I have so far and it outputs nothing and I'm not entirely sure why. I believe it is due to the a tags but I do not know what to change. Any help would be greatly appreciated.' wiki =