soup = BS(text)
MGI = soup.find(name='a', onclick=
    "UniProt.analytics('DR-lines', 'click', 'DR-MGI');").text
MGI = MGI[4:]
print(protein + ' - ' + MGI)
Using Python to ask a web page to run a search