Error interpreting special characters

1

I'm looking for an element, and so far everything's okay, I've tested it before and it worked, but .. using this code

driver.find_element_by_xpath('//*[@data-qtip="Configurações"]').click()

is an error, and cmd returns me

  File "chrome.py", line 105, in tearDown
    driver.find_element_by_xpath('//*[@data-qtip="Configura├º├Áes"]').click()

Clearly he is not finding out why the "configurations" are unconfigured

this same element works normally

driver.find_element_by_xpath('//*[@data-qtip="Sem descrição."]').click() 

I added in the code

#!/usr/bin/env python
# -*- coding: utf-8 -*-

However, the problem persists, how to proceed?

    
asked by anonymous 20.01.2016 / 19:35

2 answers

0

The way I've managed to solve:

driver.find_element_by_partial_link_text('Conf').click()

But I still can not understand why that mania does not work.

    
23.01.2016 / 14:55
0

Verify that your .py file is saved as Unicode (UTF-8) and not ASCII / ANSI. Also I would use the u prefix in the string: u'//*[@data-qtip="Configurações"]'

    
20.01.2016 / 20:31