Good day. Trying to learn from python, plugging with parsing.
import lxml.html, urllib page = urllib.urlopen('http://site.ru/').read() #сделали запрос на сайт и сохранили в переменную doc = lxml.html.document_fromstring(page) advice = doc.xpath('//title') #нашли значение тега и сохранили в переменную print (advice) All this displays the title in this format:
[<Element title at 0x7f7ecaa11ba8>] How can I get a normal Russian text instead of a certain hex?
print (advice.text_content())- KoVadimtext_content()method. You can[0]try. Related question: How can I retrieve the page title of a webpage using Python? - jfsadvice[0].text_content()- KoVadim