参考链接
wxpy: 用 Python 玩微信
Python定时自动给微信好友发送天气预报
源码 weather.py
from wxpy import *
import requests
from datetime import datetime
import time
from apscheduler.schedulers.blocking import BlockingScheduler #定时框架
from urllib.request import urlopen
from bs4 import BeautifulSoup
bot = Bot(cache_path=True)#登陆微信
tuling = Tuling(api_key='4a0488cdce684468b95591a641f0971d') #机器人api
#单个好友
#friend = bot.friends().search('魏文博')[0]#好友的微信昵称,或者你存取的备注
#location = friend.city
#print(friend)
#print(friend.city)
#好友列表
friendlist = [ensure_one(bot.search(remark_name='我们家小')),
bot.friends().search(remark_name='任')[0],
bot.friends().search(remark_name='戴文')[0],
bot.friends().search(remark_name=&