用百度 echarts 实现的图表,如何通过python+selenium 获取页面显示的数据?

新手上路,请多包涵

我打算用 python+selenium 实现对下图中各个数值的捕获。可是现在一头雾水,不知如何能定位到目标元素。
谁给帮帮忙给点建议。

 <div id="chart" class="echarts_pie" _echarts_instance_="1487904212096" style="-webkit-tap-highlight-color: transparent; user-select: none; background-color: rgba(0, 0, 0, 0); cursor: default;">
    <div style="position: relative; overflow: hidden; width: 782px; height: 470px;">
        <div data-zr-dom-id="bg" class="zr-element" style="position: absolute; left: 0px; top: 0px; width: 782px; height: 470px; user-select: none;"></div>
        <canvas width="782" height="470" data-zr-dom-id="0" class="zr-element" style="position: absolute; left: 0px; top: 0px; width: 782px; height: 470px; user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></canvas>
        <canvas width="782" height="470" data-zr-dom-id="1" class="zr-element" style="position: absolute; left: 0px; top: 0px; width: 782px; height: 470px; user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></canvas>
        <canvas width="782" height="470" data-zr-dom-id="_zrender_hover_" class="zr-element" style="position: absolute; left: 0px; top: 0px; width: 782px; height: 470px; user-select: none; -webkit-tap-highlight-color: rgba(0, 0, 0, 0);"></canvas>
    </div>
 </div>

图片描述

阅读 8.8k
2 个回答

估计是不可以的。。这个是用canvas渲染出来的。。你可以看看请求中,应该有echarts的配置数据。

新手上路,请多包涵
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
推荐问题