Text only
23 Mar 2011
 
 
Tools: wrap/unwrap  
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
>>> from grab import Grab
>>> g = Grab()
>>> g.go('http://yandex.ru')
<grab.grab.Response object at 0xb6b1338c>
>>> print g.xpath('//title').text
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: 'list' object has no attribute 'text'
>>> print g.xpath('//title')[0].text
ЯндекÑ