How to batch convert gene names to protein IDs in Uniprot?
ID mapping

This is called ID mapping. It used to be a headache as programmatic sequence comparisons were the only real way, but it is pretty trivial these days.

As mentioned in the comments, by far the most popular and easy method is to use Uniprot's list uploader for mapping. The corresponding publication can be found here. 

Example

Programmatic access

The web user interface will work for thousands of IDs, but is like to result in errors for queries exceeding 10,000 IDs. In that case programmatic queries are probably better. I've slightly modified this from the Uniprot docs so that the IDs are queried 1 at a time to avoid any errors in exceeding query size. The python code would be:

import urllib,urllib2

list_to_convert = ["b0014", "b0015"]
url = 'http://www.uniprot.org/mapping/'

print "From To"
for genename_id in list_to_convert:
    params = {
    'from':'GENENAME',
    'to':'ACC',
    'format':'tab',
    'query':genename_id
    }

    data = urllib.urlencode(params)
    request = urllib2.Request(url, data)
    contact = "" # Please set your email address here.
    request.add_header('User-Agent', 'Python %s' % contact)
    response = urllib2.urlopen(request)
    page = response.read(200000)
    print page.splitlines()[1] #Ignores the header line returned by uniprot


The output from this looks like:

From    To
b0014   P0A6Y8
b0015   P08622


Web GUI

b0014 and b0015 aren't actually STRING IDs. They are IDs referred to as gene names and are used across a variety of databases including Uniprot.

The mapper:



Note in section 2 of the ID mapping that I have set the left option to "gene name". "STRING" won't work. 

The result is below: