I try to imitate a link click using this script:
#!/usr/bin/env python
import mechanize
targetPage = 'http://example.com/'
clickUrl="http://someurlinsideexample.com/"
br = mechanize.Browser(factory=mechanize.RobustFactory())
br.open(targetUrl)
br.follow_link(url=clickUrl)
but I get this error:
File "/usr/local/lib/python2.7/dist-packages/mechanize-0.2.5-py2.7.egg/mechanize/_mechanize.py", line 620, in find_link
raise LinkNotFoundError()
mechanize._mechanize.LinkNotFoundError
What's wrong with my snippet and how to fix it?