XPATH语法contains包含和positon位置及价格大于多少的使用
# 选取class属性包含ing的href链接地址 html.xpath("//div/p[2][contains(@class,'ing')]/a/@href") # 选取价格大于20元书的价格值 html.xpath("//book[price>20.00]/price/text()") # 选取前2本书 html.xpath("//book[position()<3]/title/text()")