X-ray absorption spectra of poly-p-phenylenes and polyacenes: localization of π orbitals