To extract GO terms for a list of UniProtKB identifiers, use the UniProt batch retrieve tool as suggested above, but instead of mapping UniProtKB IDs to an external database, map from UniProtKB to UniProtKB.
Once you have your result, you can click on "Columns" and customize your result table layout, as described here or here.
The customization interface contains a section "Gene Ontology", where you can select to see a complete
list, or separate columns for the 3 ontologies molecular function, biological process or cellular component, or a list of identifiers only.
You can remove all columns you are not interested in in this context, and then download the results in tab-delimited format.
Or you can access the UniProt website programmatically, with one query per accession number:
for a given UniProtKB identifier, e.g. Q9ZUA2, you can use this URL
Please don't hesitate to contact the UniProt helpdesk if you have any additional questions.