赞
踩
爬取亚马逊商品数据代码
import requests
url = "https://www.amazon.cn/gp/product/B01M8L5Z3Y"
try:
kv = {'user-agent': 'Mozilla/5.0'}
r = requests.get(url, headers=kv)
r.raise_for_status()
r.encoding = r.apparent_encoding
print(r.text[1000:2000])
except:
print("爬取失败")
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。