php url参数时间戳,AJAX GET 请求 URL 最后面缀的那个类似于时间戳的参数是什么啊?...
Dark1X
2019-05-06 10:43:44 +08:00
@ochatokori 感謝
我在測試的時(shí)候發(fā)現(xiàn)爬蟲不加這個(gè)簽名參數(shù)也是可以的。
現(xiàn)在的問題是瀏覽器上面獲取的的數(shù)據(jù)與爬蟲獲取到的數(shù)據(jù)不一致。你有空的話復(fù)現(xiàn)幫我看看呀,麻煩了。
瀏覽器訪問: https://刪除這幾個(gè)字 wk588.com/tools/kuangjiduibi
爬蟲源碼:
```
#!/usr/bin/env python3
# coding=utf-8
import requests
import json
import re
def getPage(url):
response = requests.get(url=url)
return response.text
if __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;q=0.8,en;q=0.6'
}
jsonData = getPage('https://刪除這幾個(gè)字 wk588.com/tools/json/qbkuanjiapi.php?n=Bitcoin&dj=0.4&_=1557106802754')
#print(json.loads(jsonData))
minerInfoList = json.loads(jsonData)['data']
# 礦機(jī)名稱列表
nameList = []
# 算力列表
hashRateList = []
# 功耗列表
powerConsumptionList = []
# 能耗比列表 HashPowerConsumptionRatio
hpcRatioList = []
# 日產(chǎn)值列表
dailyEarnList = []
# 日電費(fèi)列表
powerChargeList = []
# 電費(fèi)占比列表
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])
```
創(chuàng)作挑戰(zhàn)賽新人創(chuàng)作獎(jiǎng)勵(lì)來咯,堅(jiān)持創(chuàng)作打卡瓜分現(xiàn)金大獎(jiǎng)總結(jié)
以上是生活随笔為你收集整理的php url参数时间戳,AJAX GET 请求 URL 最后面缀的那个类似于时间戳的参数是什么啊?...的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: python中getopt函数_Pyth
- 下一篇: 动态数组vector的使用_简单代码示例