官方文档:https://pyecharts.org/#/zh-cn/render_images
因之前有使用过selenium,因此选择snapshot-selenium方式渲染图片
1、安装
(1)selenium安装及配置
Python3.x安装后就默认就会有pip(pip.exe默认在python的Scripts路径下),使用pip安装selenium:
pip install selenium
安装之后需要配置虚拟浏览器。因snapshot-selenium方式目前仅支持chrome和safari,因此选择chrome作为虚拟浏览器使用,并下载chrome驱动:http://chromedriver.storage.googleapis.com/index.html
根据chrome版本选择对应驱动
chrome版本查看:浏览器-帮助-关于,或进入chrome://settings/help查看
下载之后将文件解压至浏览器所在文件夹,并添加系统环境变量:
计算机-右键属性-系统-高级系统设置-环境变量-系统变量-Path,然后选择新建将chromedriver.exe路径添加。