output_file.close() print "Cannot open the file:",file_name,e当我挑选字典或列表时,它工作得很好,但是它不适用于字典列表。我从另一个函数获取一个字典作为single_record,然后将其附加到我的列表中:
def set_dict(url.....)'au
我试图使用xPath获取@src属性,但是当我运行我的scrapy时,它返回一个空数组。谁能给我解释一下我哪里做错了? Snippet of the HTML code with the attribute xPath //div[@class='BuC9jaLeEj']//child::div/img[@class='P2llUzsDMi']/@src 使用浏览器,我能够找到标记名的路径,但是当我运行我的Scrapy机器人时,它返回一个空数组。