you can use the query functions of the python library pyuniprot.
install (with pip or git clone) and update. Find out which taxonomy identifier fits to your organisms. Example here (human, mouse, rat). Don't make a full update for all organisms (takes very long).
pyuniprot.update(taxids=[9606, 10090, 10116])
Use following python code for your problem:
if 1433E_HUMAN and A4_HUMAN are the identifiers you are looking for:
query = pyuniprot.query()
entries = query.entry(name=('1433E_HUMAN', 'A4_HUMAN'))
first_accessions = [entry.accessions for entry in entries]
gos = query.db_reference(entry_name=('1433E_HUMAN', 'A4_HUMAN'), type_='GO')
go_ids = [x.identifier for x in gos]