Get the App
SLTechnology News&Howtos  ›  Network Security  › 

Amazon crawls Amazon page information

Shulou Source: shulou.com Published: 2022-06-01 04:54:08 10月04日 Update

Code:

#-*-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)

# obtain product unit price

Span = tree.xpath ("/ / span [@ id='priceblock_ourprice'] / text ()")

Print "ASIN Code:", ASIN

Print "Unit Price:", span

# obtain product customer reviews

Cus_reviewList = tree.xpath ("/ / div [@ id='averageCustomerReviews'] / span/a/span [@ id='acrCustomerReviewText'] / text ()")

Print "Customer Reviews:", cus_reviewList [0]

# obtain product kc

Tags: Product unit price code information page Yama Amazon Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Huawei Shulou Information Apple Shulou Tech Info Shulou Technology