To follow such links, you need to add the nr parameter to the follow_link () method .
Try the following:
import mechanize
br = mechanize.Browser()
br.open('http://www.systempuntoout.com')
for link in br.links():
print(link)
br.follow_link(text='[IMG]', nr=0)
print br
>>><Browser visiting http://www.systempuntoout.com/quiz>
br.back()
br.follow_link(text='[IMG]', nr=1)
>>><Browser visiting http://www.systempuntoout.com/about>
source
share