首页 > 代码库 > amazon爬取亚马逊页面信息
amazon爬取亚马逊页面信息
代码:
# -*- 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 |
amazon爬取亚马逊页面信息
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。