【发布时间】:2016-11-26 00:27:18
【问题描述】:
我有以下 Xpath:
bathroom = response.xpath(“.//div[1][contains(., 'Baños’)]/text()").extract_first()
我得到这个错误:
ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL bytes or control characters
我已经尝试了这些其他类似问题中给出的解决方案:
Filtering out certain bytes in python
但没有人能解决我的问题!
注意:使用第一个链接的解决方案,我显然用word = "baños" 替换了'input_string',我得到了一个类似“函数的错误1 个参数,2 个给定..."
谁能帮忙?
【问题讨论】:
标签: python xpath unicode ascii