According to Wikipedia this is an ancient method of divination used at least as far back as Ancient Rome, where the name of the particular method depended on the poet uses, eg Praenestinae sortes Virgilanae for Virgil.
The sibylline books were used for this by 6th Century Greek Oracles. They weren't actually books, rather loose leaves that could be shuffled and drawn at random, and were burned in 83BC. A replica collection was also destroyed, in AD 405. The prophecies of the Greek Oracles were famously vague.
The practice became generally known as bibliomancy when people started using the Bible as their text of choice, a term which now applies generally to the use of books. The earliest recorded instance of Bible use is 1693, although the Wikipedia article doesn't give any details of the circumstances.