The invention discloses a method for extracting withanolide. The method has the characteristics of high efficiency, little pollution and simple operation, and the steps are as follows: a. Take the raw material of Indian ginseng root and grind it into 40-80 mesh, put it in the extraction kettle, at the extraction pressure of 22-27MPa, and the temperature of 40-50°C, put in liquid CO2 and entrainer, the flow rate is 20-40L / h, and extract 2-3 After 1 hour, analyze the extract; b. Add water to disperse the recovery reagent of the above extract, add it to the macroporous resin for separation, ethanol solution gradient elution, the eluate is concentrated to a small volume of crystals, recrystallized with ethanol for 2-3 times, and dried Get withanide.