I think you just need to change
sel.click(u"xpath=//a[text()='Submit \xbb')]")
to
sel.click(u"xpath=//a[text()='Submit \xbb')]".encode('utf8'))
This is because the error indicates that Selenium is trying to encode a Unicode object in a byte string (using the default codec for Python, that is, 'ascii' ), and that it crashes; at first explicitly encoding it so that it appears to be the correct codec ( 'utf8' , the default encoding in XML), so you should avoid this problem.
Alex martelli
source share