0

I use selenium .text attribute to get some text from a div,

message_text = message.find_element_by_class_name("im_msg_text").text

and if I use

print message_text

I get:

'message_text': u'\u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0442\u0435\u043a\u0441\u0442'

The question is how can I convert it to normal string containing russian letters?

1
  • instaed of using .text try to use .getText() Commented Aug 28, 2014 at 15:05

1 Answer 1

1

Try print u"{}".format(message_text) or use decoding.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.