我尝试使用以下代码从XPath表达式中提取文本内容:
page = requests.get('https://www.momondo.com/flight-search/PHL-VCE/2019-06-19-flexible/2019-06-25-flexible?sort=price_a')
tree = html.fromstring(page.content)
price = tree.xpath('//span[@class="title price"]/text()')
print(price)
然而,打印的结果只是:[]
我做错什么了吗
目前没有回答
相关问题 更多 >
编程相关推荐