7

In what formats can I retrieve texts from wikisource?

The obvious format is the HTML they deliver for reading, but the HTML source is very layout oriented and messy.

Is there a downloadable source format available that is more logical (XML or wiki format)? How can I download it?

2 Answers 2

4

For automated processing, by far the best alternative is a database dump. They might be a little bit old, but hopefully that won't be a problem.

You can select database dumps by language and wiki, with or without edit history.

At the time of writing, the most recent enwikisource dump is from 26 December 2015. You can also find dumps for dewikisource, frwikisource, etc.

3
  • Age is not a problem, but size matters: I am basically interested in a selection of about 2 dozen texts.
    – user6083
    Feb 2, 2016 at 8:15
  • @jknappen That's more of a (mediawiki) technical question. There's probably a forum somewhere on wikimedia to ask it.
    – gerrit
    Feb 2, 2016 at 10:41
  • I found out that I can export all pages from one category using Special:Export (available in the "special pages" menue). To get at the textual content, I had to check the box "include templates". The format is still crowded, but ways better than the HTML.
    – user6083
    Feb 3, 2016 at 16:36
2

If you are just interested in two dozen text I think it is easiest just to request for the raw wikitext, for instance for the 'The Metal Pig' page:

https://en.wikisource.org/wiki/The_Metal_Pig?action=raw

This query returns the raw wikitext, i.e., with unexpanded templates and category links.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.