(This is a post from a while back which is now greatly revised and re-released in time for Daf Yomi reaching this topic tomorrow).
An oft-cited example of the ability of the Sages to extract scientific knowledge from the Torah is the case of snake gestation.
(The gestation period for) a snake is seven years… How do we know this? Rav Yehudah said in the name of Rav…: As it says, “You are cursed from all the domestic animals and from all the beasts of the field” (Bereishis 3:14). If the snake is cursed more than all the domestic animals (which have a gestation period of at least five months), then surely all the more so it is cursed more than the wild animals (whose minimum gestation period is only 50 days)! Rather, it tells you that just as a domestic animal is cursed seven times more than a wild animal – namely., the donkey (which has a gestation period of one year) and the cat (whose gestation period, according the Gemara earlier, is 52 days) – so too is the snake cursed seven times more than the domesticated animal, which results in seven years. (Talmud, Bechoros 8a)
There is a different version of this story in a later source:
A certain philosopher sought to know the gestation period of a snake. He saw some mating, captured them, placed them in a vessel, and fed them. When the elders arrived in Rome, they saw Rabban Gamliel, and asked him, After how long does a snake give birth? He was not able to answer them, and his face fell. Rabbi Yehoshua met him, and asked him why he looked so down. He replied, I was asked one question, and I was not able to answer it. Rabbi Yehoshua asked, What was it? He replied, After how long does a snake give birth? Rabbi Yehoshua said, After seven years. Asked Rabban Gamliel, How do you know? Rabbi Yehoshua replied, The dog is an impure wild animal, and gives birth after fifty days, and an impure domesticated animal gives birth after twelve months; and it says, “You are cursed from all the domestic animals and from all the beasts of the field” – just as a domestic animal is cursed seven times more than a wild animal, so too is the snake cursed seven times more than the domesticated animal. Towards evening, Rabban Gamliel went out and told them. [The philosopher] began to bang his head against a wall, and said, I worked and exerted myself for seven years [to discover this], and this one comes and holds it out on a cane (i.e. answers lightly). (Yalkut Shimoni, Bereishis 3, os 30)
There are several questions to consider here. First of all, was Rav Yehudah/ Rabbi Yehoshua entirely deriving the information about snake gestation from the Torah, with no previous knowledge about this, or was this an already widespread belief? And was the exegesis his own invention, or something that he received as a tradition? There has long been much dispute amongst Rishonim and Acharonim as to the ultimate source of such Talmudic exegeses, with no less a figure than Chasam Sofer (to Beitzah 5a; also Rambam, Introduction to Commentary to the Mishnah) claiming that they are of human rather than divine origin. (Cf. the Talmudic exegeses about the nature of the firmament, which is not correct, and is thus surely not a Sinaitic tradition.)
Second of all, how does the idea of deriving facts about the natural world from the Torah fit in with the myriad of cases in the Gemara where Chazal did not have any such expectations? As I noted in my monograph on Sod Hashem Liyreyav, the Gemara does not generally believe that the Sages had any special source of knowledge about the natural world. The Talmud states that the rabbis learned agricultural information from the descendants of Seir; Rav relates that he spent eighteen months with a shepherd in order to learn about the blemishes that affect sheep; R. Shimon ben Chalafta is described as having performed experiments to discover information; Rabbi Zeira stated that his lack of knowledge of the natural sciences rendered him incapable of rendering rulings regarding menstrual blood; and we also find that Rebbi considered that the sages were proven wrong in fundamental matters of astronomy by the gentile scholars. Indeed, in the version of the snake story given in the Yalkut, we see that the Sages were not all able to derive whatever biological knowledge they wanted from the Torah. Yet on the other hand, it does seem to show that they considered themselves able to do so in some cases.
But is it actually true that a snake's gestation lasts seven years?
It has been confirmed that female snakes sometimes give birth several years after mating. In general, this seems to be due to their ability to store sperm. It has been suggested that in some extreme cases, it resulted from long term “mummification” of embryos instead. In other cases, snakes have been known to reproduce via parthenogenesis, i.e., without a male. Some scientists suggested in the past that all cases of isolated females giving birth are due to parthenogenesis rather than storing sperm or embryos from an earlier mating, but recent genetic research has shown that in at least some cases, sperm has been stored from earlier matings.
Yet although Rav Yehudah’s statement seems to be an astonishing example of scientific information being extracted from the Torah, there are some serious difficulties with it.
First of all, although in one instance it was recorded that an Arafura file snake laid eggs exactly seven years after mating, this was in one case alone. The maximum on record is nine years, with a garter snake, and the majority of snakes do not store the sperm at all; even with those that do, it is usually for far less than seven years. There is no type of snake that has a seven-year gestation - instead, individual snakes can give birth for any number of time after mating, from several weeks to nine years or more.
Second of all, the source for the Talmud's statement is an exegesis based on the ration of snake gestation to donkey gestation being the same as that of donkey gestation to the gestation of a cat (or, in the Yalkut version, a dog) - seven times greater. But whereas the gestation period of a donkey is indeed one year, the gestation period of cats is 61-69 days and that of dogs is 59-65 days - quite a bit more than the 52 and 50 days stated in the Gemara. In which case, the data about animals used as the very basis for the exegesis is incorrect.
In conclusion, then: It would seem that in general, Chazal did not expect themselves to all be able to extract desired information about the natural world from the Torah, but there are cases when such an ability is proposed. The Gemara engages in some polemics about how the Sages were smarter than the gentiles - while elsewhere it takes it as a matter of course that this was not necessarily the case. But even in cases where some Sages are presented as being able to extract such information from the Torah, this is not (according to many Rishonim and Acharonim) a matter of them conveying a Sinaitic tradtion or utilizing Divine inspiration, but rather their own ingenuity. In the case of snake gestation, while this initiative resulted in a claim about snakes that is sometimes valid, it is not ultimately correct, and the data used as the basis for the calculation was not correct.
 R. Shine, P. Harlow, J. S. Keogh, and Boeadi, (1995), ‘Biology and Commercial Utilization of Achrochordid Snakes, with Special Reference to Karung (Achrochordus javanicus),’ Journal of Herpetology, 29 (3): 352-360.
 Parthenogenesis has been documented in some lizards, insects, and other species including domestic turkeys.
 University of Arizona herpetologist Gordon W. Schuett, in “Snake Birth An Unlikely Feat,” The Detroit News, Monday October 6th 1997.
 Warren Booth and Gordon W. Schuett, "Molecular genetic evidence for alternative reproductive strategies in North American pitvipers (Serpentes: Viperidae): long-term sperm storage and facultative parthenogenesis." See http://www.newscientist.com/article/mg21228355.200-snake-stores-sperm-for-five-years-before-giving-birth.html
 Magnusson, W. E. (1979), “Production of an embryo by an Achrochordus javanicus isolated for seven years,” Copiea: 744-745.
 Robert T. Mason, Department of Zoology, Oregon State University.