5

This is a technical question, but I hope it's on topic. The Perseus project contains lots and lots of Latin and Greek texts (and other languages too). I sometimes want to download an entire text from Perseus. There is an XML button at the bottom of every text page which gives you the XML for that page, which is useful; but since texts come "chunked" into books or sections, that button only yields the XML for that book or section. Is there a way to get the entire text?

For example, at the moment I'd like to download the text of Dionysius of Halicarnassus De Demosthene. It's available here, but chunked into chapters. I could fetch the XML for each of the 58 chapters and then paste them together, but that's unappealingly laborious and I suspect there's a quicker way. Is there?

ETA: I'm mostly interested in Greek texts, so I specifically don't want to download an XML in beta code, but a readable Greek-script text.

ETA 2: The entire Perseus corpus can be downloaded here as a single archive. This almost solves the problem, except that the texts are in XML, and the Greek texts are in beta code. It would be nice to have XML-stripped, Greek-script texts.

  • This is a question I'm interested in too—so if you find a way to get the full thing as betacoded XML, I have a script to convert that into nice readable Greek that I can share. – Draconis Apr 15 '19 at 3:05
  • @Draconis, that would be useful -- I actually wrote such a script years ago, but have since lost both it and the rudimentary coding knowledge that allowed me to write it. Could you share yours? It turns out you can download the entire Perseus corpus, which I've done (see edit), but the Greek texts are all in beta code. – TKR Apr 15 '19 at 3:10
  • @Draconis and TKR: Such a code would actually make a nice separate question and answer on its own. The technology needed to study the languages of the site is very much on topic, and we haven't had much of that yet. – Joonas Ilmavirta Apr 15 '19 at 3:16
3

I presume that you've been clicking the orange XML button directly below the chunk of text.

If you look beneath that, in the gray box that gives licensing info, the second paragraph has an XML version link. This will open/download a copy of the complete text (in Betacode though, which I know you don't really want), not just the chunk that you're viewing.

XML button and XML version link

| improve this answer | |
1

The FAQ states:

How can I download a complete text file?

Our copyright agreements with the publishers of our texts do not permit us to offer full text downloading for all works in Perseus at this time. Texts for which XML downloads are available are indicated as such by a creative commons license and links to download options. You will find these in the center of a text viewing page, below the main focus text. We do not offer other formats for texts at this time.

This of course, does not mean you cannot do it yourself. Some method would go like this:

  1. Use a command line tool (or perhaps a software?) to download many pages in one go. For Linux, check these instructions. For all platforms, check this tool. Notice all the XML pages have this format:

    http://www.perseus.tufts.edu/hopper/xmlchunk?doc=Perseus%3Atext%3A2008.01.0580%3Achapter%3D1

    and chapters go from 3D1 to 3D58, so the download can be easily automatised.

  2. Merge the XML files. There are tons of tools for this (e.g. here).

  3. Convert to PDF or other format. Notice you will need an encoding different from "utf-8" to parse the Greek letters. Best tools might be based on XSLT.

| improve this answer | |
  • 1
    Just one correction: the %3D isn't part of the number, it's the escape code for the = character. So the URLs go from chapter=1 to chapter=[whatever], keep going until you get a 404. – Draconis Apr 15 '19 at 23:18
  • @Draconis Indeed. What I meant was that to get the automated download, the script needs to run from 3D1 to 3D58. – luchonacho Apr 16 '19 at 6:29
1

Before using, please read the copyright information in the readme.md file. https://github.com/PerseusDL/canonical-greekLit

Please note also that this is a work in progress: https://github.com/PerseusDL/canonical-greekLit/wiki

The above is in unicode, not beta code. But also note that there are a few betacode to unicode translators available.

| improve this answer | |

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.