Rhapsodomancy is a form of divination in which guidance was sought through the chance selection of a passage in literature, often by opening a book and selecting the first line seen. The book was originally of verse and the technique is a form of bibliomancy, the art and practice of divination by books.
It goes back to the ancient Greeks, in which verses uttered by the oracles were transcribed for random consultation in the sybilline books, or in which a phrase from one of the poets was picked on for guidance. Another example is the I Ching, an ancient book of wisdom in which hexagrams are consulted according to a random sequence that is generated by throwing sticks.
Rhapsodomancy comes from the Greek rhapsoidos, someone who recites epic poems, particularly the Homeric odes; its roots are rhaptein, to sew together or stitch, and oide, song (the source of our word ode), so such a person was a weaver of songs. It is closely related to our rhapsody, which originally meant a section of an epic poem suitable for reading at one time, but which later took on the modern sense of some exaggeratedly enthusiastic or self-indulgently effusive piece of writing or music.
In Latin, a related idea is variously called sortes Virgilianae, sortes Homericae or sortes Biblicae and refers to the seeking of guidance by chance selection of a passage in Virgil, Homer, or the Bible.