HTML:
Example website
水果:苹果 运动:足球 语言:中文
我想得到这样的结果:
>>> response.xpath('//p[@id="demo"]/p/text()').re(r'')
u'苹果'
>>> response.xpath('//p[@id="demo"]/p/text()').re(r'')
u'足球'
>>> response.xpath('//p[@id="demo"]/p/text()').re(r'')
u'中文'
问题:
上面re(r'')中的正则表达式该怎么写?
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
学习是最好的投资!