On Thu, Aug 9, 2012 at 8:16 AM, Pavan Kumar <pavankumarstudent@yahoo.com> wrote:
Hi all,
I am new to wikipedia API.
can you help me with the following:
I want to grep all the content of the "united states of america" to a text file with out images.
I am looking a response in text format.

How can I do that?
looking for: http://en.wikipedia.org/wiki/United_States  page contents.

I got this url constructed:
http://en.wikipedia.org/w/api.php?format=xml&action=query&titles=united_states&prop=revisions&rvprop=content 
But I am not getting what I want ..:(.may be I am missing some thing basic

A simple mistake: You are writing the article in lowercase.
 

Try with http://en.wikipedia.org/w/api.php?format=xml&action=query&titles=United_States&prop=revisions&rvprop=content

I did based on http://en.wikipedia.org/w/api.php..

1.how can I get the content of what ever string I give in the query?
    please help me with the url.
2. I am trying to have this in a text file. can I get the response in the text format? other than xml and json?

See the list of formats at https://www.mediawiki.org/wiki/API:Data_formats#Output
 

3. In the unites_states example, I want to get the  first coulm of the citys (
Leading population centers

)
how can I get that .   

Extracting content from the inside of the article content will require you to perform some parsing of the wikitext.