本帖最后由 szx666 于 2021-5-11 23:18 编辑
[Python] 纯文本查看 复制代码 import requests
import json
url = 'https://sf-item.taobao.com/json/get_bid_records.htm?_ksTS=1620740116592_604&callback=jsonp605&id=641634330827&records_type=pageRecords¤tPage='
headers = {
'Referer': 'https://sf-item.taobao.com/sf_item/641634330827.htm?spm=a213w.7398504.paiList.1.52bd533aQrsYmj'
'&track_id=2151e118-70ef-4958-bfe3-24d7937454ff'
}
def a(pageB):
response = requests.get(url=url + str(pageB), headers=headers).text
d = response[0: 10]
response = response.replace(d, '')
response = response.replace('(', '')
response = response.replace(')', '')
response = response.replace('totalCnt', '"totalCnt"')
response = response.replace('records', '"records"')
response = response.replace('alias', '"alias"')
response = response.replace('date', '"date"')
response = response.replace('price', '"price"')
response = response.replace('bidTime', '"bidTime"')
response = response.replace('formatePrice', '"formatePrice"')
response = response.replace('status', '"status"')
response = response.replace('isSelf', '"isSelf"')
response = response.replace('ceilingPriceBid', '"ceilingPriceBid"')
response = response.replace('priorityUser', '"priorityUser"')
b = json.loads(response)['records']
c = len(b) - 1
if c != -1:
print(b)
pageB += 1
a(pageB)
else:
print('打印完成')
a(1)
凑合着看吧,大概就是这个意思 |