python运势预测程序_运势.py · Scar/Python-Spider - Gitee.com

# encoding:utf-8

import requests

import json

class Yunshi():

def __init__(self,url):

self.url = url

def resp(self):

response = requests.get(self.url).text

data = json.loads(response)

# 速配星座

QFriend = data["QFriend"]

# 综合指数

all = data['all']

# 幸运颜色

color = data['color']

# 健康指数

health = data['health']

# 财运指数

money = data['money']

# 工作指数

work = data['work']

# 爱情指数

love = data['love']

# 幸运数字

number = data['number']

# 描述

summary = data['summary']

print('''

# 速配星座 {0}

# 综合指数 {1}

# 幸运颜色 {2}

# 健康指数 {3}

# 财运指数 {4}

# 工作指数 {5}

# 爱情指数 {6}

# 幸运数字 {7}

# 描述 {8}

'''.format(QFriend,all,color,health,money,work,love,number,summary))

if __name__ == '__main__':

datatimes = ['today','tomorrow','month','year']

for info in datatimes:

url = "https://constellation.vivo.com.cn/constellation?consName=%E5%8F%8C%E9%B1%BC%E5%BA%A7&type={0}".format(info)

ys = Yunshi(url)

ys.resp()

一键复制

编辑

Web IDE

原始数据

按行查看

历史

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值