mirror of https://github.com/scrapy/scrapy.git
small fix for string representation of XPathSelector when the node is not an xml object
--HG-- extra : convert_revision : svn%3Ab85faa78-f9eb-468e-a121-7cced6da292c%4085
This commit is contained in:
parent
97b2e7df55
commit
5778ecf15d
|
|
@ -78,7 +78,7 @@ class XPathSelector(object):
|
|||
self.doc.xpathContext.xpathRegisterNs(prefix, uri)
|
||||
|
||||
def __str__(self):
|
||||
return "<%s (%s) xpath=%s>" % (type(self).__name__, getattr(self.xmlNode, 'name'), self.expr)
|
||||
return "<%s (%s) xpath=%s>" % (type(self).__name__, getattr(self.xmlNode, 'name', type(self.xmlNode).__name__), self.expr)
|
||||
|
||||
__repr__ = __str__
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue