A novel poly(citric acid-ethylene glycol)/LiI/I2 (PCE/LiI/I2) solid polymer electrolyte (SPE) based on the biodegradable PCE matrix has been prepared in situ, by penetrating of the PCE prepolymer sol into mesoporous TiO2 photoanode, followed by curing. The PCE prepolymer can easily penetrate into the mesoporous photoanode, which could induce good interfacial contact between the SPE and photoanode. Assembled with the SPE, highly efficient and stable solid-state dye-sensitized solar cells (DSSCs) have been gained due to the good interfacial contact of SPE/TiO2 photoanode as well as the favorable ionic conductivity of the SPE. The results show that the contents of CA determine the aggregation structure such as the inter-segmental distance and free volume of the PCE matrix, which consequently affects the ionic diffusion coefficient and conductivity of the PCE/LiI/I2 electrolyte, and accordingly the photoelectric performance of the DSSCs. With CA content of 32.4 wt%, the SPE reaches the optimal ionic conductivity of 5.43 × 10−5 S cm−1 and the solid-state DSSCs obtain the best overall photoelectric conversion efficiency of 1.22 % at 60 mW cm−2.