The electronic structure and molecular orientation of semiconducting polymers in thin films determine their ability to transport charge. Methods based on near-edge X-ray absorption fine structure (NEXAFS) spectroscopy can be used to probe both the electronic structure and microstructure of semiconducting polymers in both crystalline and amorphous films. However, it can be challenging to interpret NEXAFS spectra on the basis of experimental data alone, and accurate, predictive calculations are needed to complement experiments. Here, we show that first-principles density functional theory (DFT) can be used to model NEXAFS spectra of semiconducting polymers and to identify the nature of transitions in complicated NEXAFS spectra. Core-level X-ray absorption spectra of a set of semiconducting polymers were calculated using the excited electron and core-hole (XCH) approach based on constrained-occupancy DFT. A comparison of calculations on model oligomers and periodic structures with experimental data revealed the requirements for accurate prediction of NEXAFS spectra of both conjugated homopolymers and donor–acceptor polymers. The NEXAFS spectra predicted by the XCH approach were applied to study molecular orientation in donor–acceptor polymers using experimental spectra and revealed the complexity of using carbon edge spectra in systems with large monomeric units. The XCH approach has sufficient accuracy in predicting experimental NEXAFS spectra of polymers that it should be considered for design and analysis of measurements using soft X-ray techniques, such as resonant soft X-ray scattering and scanning transmission X-ray microscopy.