Poly(vinyl alcohol) (PVA)/CdS and PVA/TiO 2 nanocomposite thin films were prepared at different semiconductor nanoparticles ratio (20, 30, 40 and 50 CC) by employing electrospinning method. For the former, CdS nanoparticles were first synthesized using cadmium nitrate (Cd (NO 3 ) 2 ) and sodium sulfide (Na 2 S) in a simple and economical way whereas for the latter, TiO 2 was purchased. Morphology and structure of nanocomposites were characterized by X-ray diffraction (XRD) and scanning electron microscope. The results indicated the cubic and anatase structure of CdS and TiO 2 nanoparticles in PVA matrix, respectively, and proved that nanoparticles were successfully coated by PVA molecules. Optical properties of samples were also characterized by diffuse reflectance spectroscopy. Particle sizes of CdS and TiO 2 , \9 and 15 nm, respectively, were calculated with the results obtained from XRD observation and it was found to be in agreement with the absorption spectra of both nanocomposites. The prepared films at 50:50 ratio, in both PVA/CdS and PVA/TiO 2 , were found to be suitable for application in solar cell as a window layer due to the crystalline phase, favorable band gap (2.53, 3.31 eV) and higher optical transmittance.