import requests
import re
def get_sales_data(url):
headers = {
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'
}
response = requests.get(url, headers=headers)
html = response.text
pattern = re.compile(r'"soldQuantity":(\d+)')
result = pattern.search(html)
if result:
return result.group(1)
else:
return None
if __name__ == '__main__':
url = 'https://detai
用Python获取商品销量数据
文件列表
python获取商品销量数据.rar
(预估有个1文件)
python获取商品销量数据.txt
1KB
暂无评论