消息推送支持图片


默认安装后,推送的消息是不支持K线图片的,需要按照以下教程操作后,才可以支持

支持图片示例

示例

pyecharts 渲染图片文档 :https://pyecharts.org/#/zh-cn/render_images

项目中使用的是 pyecharts + selenium 渲染图片的扩展

图片上传用的飞书的图片上传,需要开通 获取与上传图片或文件资源(im:resource) 权限

https://open.feishu.cn/document/server-docs/im-v1/image/create?appId=cli_a503a353effd100b

1. pip 安装相关依赖

pip install snapshot-selenium

2. 安装 selenium 的 browser driver

官方文档:https://selenium-python.readthedocs.io/installation.html#drivers

Ubuntu 安装步骤

# https://blog.csdn.net/weixin_45541986/article/details/125017752

wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb
sudo dpkg -i --force-depends google-chrome-stable_current_amd64.deb
sudo apt --fix-broken install
sudo apt install libgtk2.0-0
LATEST=$(wget -q -O - http://chromedriver.storage.googleapis.com/LATEST_RELEASE)
wget http://chromedriver.storage.googleapis.com/$LATEST/chromedriver_linux64.zip
unzip chromedriver_linux64.zip
chmod +x chromedriver
sudo mv chromedriver /usr/bin/

3. 如上,程序可以正常渲染图片并上传到飞书,即可在推送消息中增加图片