美丽乡村建设发展论坛网站,软件ui设计软件,沈阳做网站,江苏省水利工程建设局网站Dark1X2019-05-06 10:43:44 08:00ochatokori 感谢我在测试的时候发现爬虫不加这个签名参数也是可以的。现在的问题是浏览器上面获取的的数据与爬虫获取到的数据不一致。你有空的话复现帮我看看呀#xff0c;麻烦了。浏览器访问#xff1a; https://删除这几个字 wk588.com/to…Dark1X2019-05-06 10:43:44 08:00ochatokori 感谢我在测试的时候发现爬虫不加这个签名参数也是可以的。现在的问题是浏览器上面获取的的数据与爬虫获取到的数据不一致。你有空的话复现帮我看看呀麻烦了。浏览器访问 https://删除这几个字 wk588.com/tools/kuangjiduibi爬虫源码#!/usr/bin/env python3# codingutf-8import requestsimport jsonimport redef getPage(url):response requests.get(urlurl)return response.textif __name__ __main__:headers {User-Agent:Mozilla/6.0 (X11; Linux armv7l) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.84 Safari/537.36,Accept-Encoding: gzip, deflate, sdch,Accept-Language: en-GB,en-US;q0.8,en;q0.6}jsonData getPage(https://删除这几个字 wk588.com/tools/json/qbkuanjiapi.php?nBitcoindj0.4_1557106802754)#print(json.loads(jsonData))minerInfoList json.loads(jsonData)[data]# 矿机名称列表nameList []# 算力列表hashRateList []# 功耗列表powerConsumptionList []# 能耗比列表 HashPowerConsumptionRatiohpcRatioList []# 日产值列表dailyEarnList []# 日电费列表powerChargeList []# 电费占比列表powerChargeRateList []# 每日净收益列表dailyRetainedProfitList []for miner in minerInfoList:if miner[sh] SHA-256:minerName re.sub(.*?,,miner[name],2)nameList.append(minerName)hashRateList.append(miner[kjsn][xs])powerConsumptionList.append(miner[kjgh][xs])hpcRatioList.append(miner[kjdwgh][xs])dailyEarnList.append(miner[rcz][xs])powerChargeList.append(miner[rcdf][xs])powerChargeRateList.append(str(miner[dfzb][sz])%)dailyRetainedProfitList.append(str(miner[rcsy][sz]))print(len(nameList))for i in range(len(nameList)):print(%-20s % nameList[i] \t hashRateList[i] \t\t powerConsumptionList[i] \t\t dailyEarnList[i])