5

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?

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.

  • Age is not a problem, but size matters: I am basically interested in a selection of about 2 dozen texts. – jknappen Feb 2 '16 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 '16 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. – jknappen Feb 3 '16 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, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.