【发布时间】:2019-10-07 16:56:08
【问题描述】:
我正在尝试将表格数据导入 Google 表格。网站上的表格不断将新数据添加到顶部。 (最新交易数据)。我对网络抓取和 HTML 代码真的很陌生。我什至不确定我是否正在查看正确的 HTML 元素,或者我是否应该查看 ImportXML 的 XPATH。
网址是:https://www.deribit.com/main#/options?tab=all
XPATH: //*[@id="tradesScrollC"]
Element: <div id="tradesScrollC" class="table-scrollable-deribit" style="max-height: 200px;overflow-y: auto" onscroll="BTCOptions.scrollTradesC(event);">
<table class="table table-hover table-condensed table-nopadding" float-thead="floatTheadOptions">
<thead>
<tr>
<th ng-i18next="app.assets">Assets</th>
<th ng-i18next="app.price">Price</th>
<th ng-i18next="app.imp_v">IV</th>
<th ng-i18next="app.Qty">Qty</th>
<th ng-i18next="app.time">Date Time</th>
</tr>
</thead>
<tbody id="last_trades_call"></tbody>
</table>
</div>
我已经尝试过 importXML 和 importHTML,但是,我不确定每个标签是什么以及我是否正确使用它。
=IMPORTXML("https://www.deribit.com/main#/options?tab=all", "//div[@id='tradesScrollC']/table")
我想打印网站上更新的所有贸易数据,也打印在我的谷歌表格上。列标题与网站完全一样(资产价格 IV 数量日期时间)
【问题讨论】:
标签: xpath web-scraping google-sheets google-sheets-formula google-sheets-importxml