Real-time high-temperature CT scanning and a rock-mechanics test system were employed to investigate the mechanical properties of oil shale at temperatures from 20 to 600 degrees C. The results reveal that up to 400 degrees C, the aperture of fractures initially decreases and then increases when loading is perpendicular to the bedding. However, the number and aperture continuously increase when loading is parallel to the bedding. Beyond 400 degrees C, the number of pores increases and the aperture of the fractures becomes larger with rising temperature. The changes in microstructures significantly impact the mechanical properties. Between 20 and 600 degrees C, the compressive strength, elastic modulus, and Poisson's ratio initially decrease and then increase under perpendicular and parallel bedding loadings. The compressive strength and elastic modulus reach minimum values at 400 degrees C. However, for Poisson's ratio, the minimum occurs at 500 degrees C and 200 degrees C under perpendicular and parallel bedding loadings, respectively. Simultaneously, while the crack damage stress during perpendicular bedding loading, sigma cd-per, initially exhibits an upward trend followed by a decline and subsequently increases again with temperature increasing, the initial stress during perpendicular bedding loading, sigma ci-per, parallel bedding loading, sigma ci-par, and damage stress, sigma cd-par, decrease initially and then increase, reaching minimum values at 400 degrees C. These research findings provide essential data for reservoir reconstruction and cementing technology in the in situ mining of oil shale.