javascript - 从使用 jqplot 的网站上的绘图中获取原始数据

标签 javascript php html json jqplot

我正在尝试获取使图表标记为“过去 24 小时余额:1HS8cq9TDNqr77nwW6WwUZBjSDBLsmpt6e”的原始数据。我可以告诉他们使用 jqplot 来绘制数据,但无法在获取数字的源中找到数据。我假设它可能在 javascript 中的某个地方,因为 html 指向调用 javascript 类的 Canvas ,但我找不到它。

这是我试图从 https://www.ahashpool.com/wallet.php?wallet=1HS8cq9TDNqr77nwW6WwUZBjSDBLsmpt6e 获取数据的网站

最佳答案

这个问题主要涉及更广泛的主题,即网络抓取,以下是使用浏览器开发工具追踪数据源的主要步骤:

  1. 在页面上找到用于绘制图表的元素,在我们的例子中就是 <div id='graph_earnings_results' style='height: 240px;'></div> .
  2. 查看js代码(在本例中它完全位于页面<script>标签中),搜索对'graph_earnings_results'的引用元素。唯一的地方是graph_earnings_init(data)函数,在其中创建绘图:$.jqplot('graph_earnings_results', t, {...}); .
  3. graph_earnings_init(data)graph_earnings_ready(data) 调用的函数,这又是 graph_earnings_refresh() 中的 AJAX 回调功能。
  4. 最后,数据源URL可以在graph_earnings_refresh()中找到。函数,var url = ... 。因此,完整的数据源 URL 将是 https://www.ahashpool.com/wallet_graph_earnings_results.php?wallet=1HS8cq9TDNqr77nwW6WwUZBjSDBLsmpt6e

关于javascript - 从使用 jqplot 的网站上的绘图中获取原始数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48369171/

相关文章:

html - IE9 缩放屏幕问题

javascript - 如何在使用 js 克隆整个 <div> 时更改 <embed> 中的 src 值?

javascript - 将 jtable 导出到 IE 上的 javascript 中的 excel

javascript - React-router-dom - 链接更改 url 但不呈现

php - 如果 rowCount 为空,请重试

php - 如何在 html/php 中增加变量

html - 范围 slider - 如何在轨道上添加垂直线?

javascript - 我可以在 Node 的全局范围内覆盖 ES 6's Promise by bluebird' 的实现吗?

php - 如何在 cmd 上的 telnet 工作正常时在浏览器上运行 Ratchet 的 shell 脚本

javascript - 忽略鼠标事件可点击区域上的标签