Q:

Python can't find character

I've written a simple statement that does something when I take a string from some html source, but when I write:
if 'p\xd1\x83\xd0\xb1.' in item:
#other code

the code in the if doesn't run.
That's how I take the source:
source=urlopen(link).read().decode('utf-8')

P.S. I split the source in a list of string then I loop through it.. item is a portion of the entire html source
EDIT: in my case item is somethig like:
<p> руб.230 </p>

A:

p\xd1\x83\xd0\xb1. is a string of bytes. By decoding it as UTF-8, you convert the string of bytes into a string of unicode characters:
>>> 'p\xd1\x83\xd0\xb1.'.decode('utf-8')
u'p\u0443\u0431.'
>>> print u'p\u0443\u0431.'
pуб.

They're not the same. If you want to check for the existence of the substring in the list, either treat the HTML as bytes and don't decode it, or decode it and check if the Unicode characters are a substring:
if u'p\u0443\u0431.' in text:
    ...

Or more readably:
if u'руб.' in text:
   ...

You may need to declare a character encoding at the top of your Python script if you include the unicode characters in your source:
# -*- coding: utf-8 -*-

Also, that Latin p should probably be a Cyrillic р. The two look the same, but they're different characters entirely.

