|
|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
代码如下:
import urllib.request
import time
url="https://junglescoutpro.herokuapp.com/api/v1/est_sales"
rank="1"
category="Beauty+%26+Personal+Care"
store="us"
header={"User-Agent":"Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36"}
a=1
while int(rank)<101:
url=url+"?"+"rank="+rank+"&"+"category="+category+"&"+"store="+store
req=urllib.request.Request(url,headers=header)
response=urllib.request.urlopen(req)
html=response.read()
print(html)
a+=1
rank=str(a)
time.sleep(5)
我想要爬取“https://www.junglescout.com/estimator/”网站的1-100的销售数据,但是返回的只有100行“b'{"status":false,"code":0,"message":"Request not allowed!"}'”这个东西,求大神赐教解决思路。它是怎么判断我是通过爬虫访问的?
还是刚刚回复那句话,再加一句,练习先找能爬的网站练
|
|