10

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.

3
  • 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, 2019 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, 2019 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, 2019 at 3:16

4 Answers 4

9

I know this question is already (somewhat) answered, but I visited the link in the answer above provided by techvslife and reading through it, I found out that there is now a project called the Scaife Viewer, which is meant to be a beta version of a new Perseus Digital Library:

Scaife Viewer official link: https://scaife.perseus.org/

About the Scaife Viewer

The Scaife Viewer is a reading environment for pre-modern text collections in > both their original languages and in translation. It is the first phase of work towards the next version of the Perseus Digital Library, Perseus 5.0.

Most importantly, Scaife Viewer allows you to show the entire text of any work available in Perseus Digital library (or you can pick any subsection of the work to be shown, if you do not need the whole text). You can even show a translation alongside the original.

Moreover, if you open the right menu column, there's a section called Export Passage which will allow you to download the passage either in txt or xml format.

Entire Scaife Viewer library is here: https://scaife.perseus.org/library/

6

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

1
  • Unfortunately, that doesn't work for Smith's dictionaries!
    – cmw
    May 2, 2022 at 20:28
4

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.

3

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 1 to 58, so the download can be easily automatised. (As per the comment below, %3D is the escape code for the = character; you may or may not have to include it.)

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

  2. 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.

2
  • 2
    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, 2019 at 23:18
  • 1
    @Draconis Indeed. What I meant was that to get the automated download, the script needs to run from 3D1 to 3D58.
    – luchonacho
    Apr 16, 2019 at 6:29

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.

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