Найти - Пользователи
Полная версия: Помогите пожалуйста с xpath
Начало » Python для новичков » Помогите пожалуйста с xpath
1
gelius
urls = urls.xpath('//a[re:match(@href, "(world)") ]/@href', namespaces={"re": "http://exslt.org/regular-expressions"})
Выдает “AttributeError: ‘unicode’ object has no attribute ‘xpath’”
В то же время
urls = urls.xpath('//a[not(re:match(@href, "(bannedworld)")) ]/@href', namespaces={"re": "http://exslt.org/regular-expressions"})
отрабатывает без ошибок.
JOHN_16
ну если вы считаете что мы сами должны догадываться что такое urls и какой код ему предшествовал, то я скажу что у вас там объект unicode который не имеет атрибута xpath.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB