Electronic structure of La2−xSrxCuO4 and YBa2Cu3O7−y