A
A
andrewwwmath2016-05-27 01:03:26
Python
andrewwwmath, 2016-05-27 01:03:26

Python 2.7.9, webbrowser: part of Cyrillic letters disappears in input. What could be the problem?

I am automating a form (python 2.7.9, webbrowser, Chrome). On the site, the encoding is cp1251.
The task is to type Cyrillic text in input.
The problem is that the letters u, o, p, p, s, t, y, f, x, c, h, sh u, b, s disappear from the text.

text = "Текст в поле"
obj_name_ru = browser.find_element_by_id("obj_name_ru")
obj_name_ru.send_keys(text)

I changed the encoding in the file header (tried utf8 and cp1251), tried to initially set the text in unicode - u"Text in the field" , tried to use text = unicode(text, "cp1251") before sending the text to the field . All this did not help solve the problem.
In which direction to look, where to dig to find a solution? Has anyone experienced a similar issue, how did you manage to resolve it?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question