代码:
# -*- coding: cp936 -*- import requests from lxml import etree ASIN = 'B00X4WHP5E' #ASIN = 'B017R1YFEG' url = 'https://www.amazon.com/dp/'+ASIN r = requests.get(url) html = r.text tree = etree.HTML(html) #获取产品单价 span = tree.xpath("//span[@id='priceblock_ourprice']/text()") print "ASIN码:",ASIN print "单价:",span #获取产品customer reviews cus_reviewList = tree.xpath("//div[@id='averageCustomerReviews']/span/a/span[@id='acrCustomerReviewText']/text()") print "Customer Reviews:",cus_reviewList[0] #获取产品kc |
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。