We successfully applied the Green function theory in GW approximation to calculate the quasiparticle energies for semiconductors Si and GaAs. Ab initio pseudopotential method was adopted to generate basis wavefunctions and charge densities for calculating dielectric matrix elements and electron self-energies. To evaluate dynamical effects of screened interaction, GPP model was utilized to extend dieletric matrix elements from static results to finite frequencies. We give a full account of the theoretical background and the technical details for the first principle pseudopotential calculations of quasiparticle energies in semiconductors and insulators. Careful analyses are given for the effective and accurate evaluations of dielectric matrix elements and quasiparticle self-energies by using the symmetry properties of basis wavefunctions and eigenenergies. Good agreements between the calculated excitation energies and fundamental energy gaps and the experimental band structures were achieved.