鱼C论坛

 找回密码
 立即注册
查看: 2273|回复: 0

python爬虫京东商智遇到的权限问题求助

[复制链接]
发表于 2022-8-22 11:52:10 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
请问一下,我用python爬取一个SKU的各项数据,是在京东商智那里爬取,免费版本可以看到的数据,但是运行后却提示我没有权限,麻烦帮忙看看如果处理这个权限问题呢?

代码如下:

import requests
import re
from bs4 import BeautifulSoup as BS
import pandas as pd
import time
from datetime import datetime, date, timedelta


yesterday = date.today() + timedelta(days = -1)
cookie='__jdu=1372343678; shshshfpa=4e47a5aa-984e-5684-bf59-7077c1fd7399-1654159689; shshshfpb=wNY7-ArEHFZ0xLUbM3Ag59w; areaId=19; ipLoc-djd=19-1657-4102-0; unpl=JF8EAItnAGQiaENSBBgFGhpCQ15VC1haSBcLajcABlkNGFQAHVUZRRRNbVdfXgtXFgpzZwNFXVhAVAIQAxsiEEptVF9cCUsTC2tkAGRtaEhUNRoyGxAWSF9RXFoOQiczaGcMZG1oTlQEGgYYExdOVWRfbQpKFgFmYwBRWlF7H2saTxsQFkhfUVxaDkInAl9k; __jdv=76161171|jxjg.softxv.cn|t_1000159524_|tuiguang|9702609c920d4c2194a4c5db147f3f57|1660706162001; PCSYCityID=CN_440000_442000_0; shshshfp=f2260b9c9ad7b7c9804057efa80a2663; pinId=rsGaSbR5eC8rID66QloT_Q; pin=jd_BfwsIbHOiKeO; unick=jd_BfwsIbHOiKeO; _tp=/wqkR9gL5mPTMQJisaQWEA==; _pst=jd_BfwsIbHOiKeO; 3AB9D23F7A4B3C9B=C3PIDAWRSFOXSXJ7N7IRXYU3FEYZU4TWQJWNPTVOTZZYSDOKGU7MUYIECWAKUACISQC44R76AA6WNGHJ5BNFVBTIIQ; wlfstk_smdl=gb51m4tjx08di48vej2128gtlqsvtzta; TrackID=11ZGcKsxr7g3EbKIC5PDmi5npoEgzxeVJYTD7nIUY2PmMACqJzICbUOyVJcllLvKRBoK-J6DjtMNNQXoxXW5qgUScw1MPuwoggA-TOCplvHo; thor=80EB1558A86319B3F734A8DFA7440CB737A30A503DEB2E989AE60A582369DEB3CF347B3631EAE3468652E94A93590137D2E2AAEC786F41984092F681412109BFCA216A7E695F406B425E76735E33C56E54E734D31BEB8311CC9B2953B1A325CBE8B503F70DC957DAFBBC244EA18C2BA60896787ED9D6376BE8C8F0216032E08F13062D07DF911DC78ED45992CBB0586C570027710E4C5040A4C22D97FD5F7694; ceshi3.com=000; __jda=243891652.1372343678.1654159687.1660982483.1661136653.42; __jdc=243891652; __jdb=243891652.6.1372343678|42.1661136653'
sku_id='100019883250'
headers={

        'cookie': cookie,
        'p-pin': 'jd_BfwsIbHOiKeO',
        'referer': 'https://ppzh.jd.com/brand/dealAnalysis/dealSummary.html',
        'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/104.0.0.0 Safari/537.36'}


params={
        'firstCategoryId':'&',
        'secondCategoryId':'&',
        'thirdCategoryId': 'all',
        'channel': '0',
        'brandId': 'all',
        'shopType': 'all',
        'skuId': sku_id,
        'date': yesterday,
        'startDate': yesterday,
        'endDate': yesterday,
        'type': '1',
        'uuid': '64a75fef1a713d6ec5a2-182b9e3f9de'}

response=requests.get('https://ppzh.jd.com/brand/dealAnalysis/dealSummary/getVenderDealSummayData.ajax?',headers=headers,params=params)
response.encoding = response.apparent_encoding
print(response.text)


这里运行后提示
{"message":"success","content":{"code":-1,"data":"没有权限"},"status":0}


想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-11-17 00:05

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表