Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/xpath/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xpath 从表中提取数据,网站在表中不断向表中输入新数据_Xpath_Web Scraping_Google Sheets_Google Sheets Formula_Google Sheets Importxml - Fatal编程技术网

Xpath 从表中提取数据,网站在表中不断向表中输入新数据

Xpath 从表中提取数据,网站在表中不断向表中输入新数据,xpath,web-scraping,google-sheets,google-sheets-formula,google-sheets-importxml,Xpath,Web Scraping,Google Sheets,Google Sheets Formula,Google Sheets Importxml,我正试图把一张表格的数据输入谷歌表格。网站上的表格不断向顶部添加新数据。(最新贸易数据)。我对网页抓取和HTML代码非常陌生。我甚至不确定我是在看正确的HTML元素,还是应该看ImportXML的XPATH URL是: XPATH: //*[@id="tradesScrollC"] Element: <div id="tradesScrollC" class="table-scrollable-deribit" style="max-height: 200px;overflow-y: a

我正试图把一张表格的数据输入谷歌表格。网站上的表格不断向顶部添加新数据。(最新贸易数据)。我对网页抓取和HTML代码非常陌生。我甚至不确定我是在看正确的HTML元素,还是应该看ImportXML的XPATH

URL是:

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>

我想打印所有的贸易数据,因为它在网站上更新,也打印在我的谷歌表。列标题与网站完全相同(资产价格IV数量日期时间)

这不是关于公式,而是关于网站。您需要找到一个不同的页面,因为GoogleSheets无法抓取JavaScript内容。您可以通过禁用给定站点的JS来检查这一点,您将看到一个空白页面,如:


这就是您所能得到的:



好的,那么澄清一下,我不能用这种方式将数据拉入谷歌工作表?你还有别的建议吗?有一个Deribit API,但我不熟悉API
=IMPORTXML("https://www.deribit.com/main#/options?tab=all", "//div[@id='tradesScrollC']/table")
=ARRAY_CONSTRAIN(IMPORTXML("https://www.deribit.com/main#/options?tab=all", "//*"), 1000, 10)
=ARRAY_CONSTRAIN(IMPORTDATA("https://www.deribit.com/main#/options?tab=all"), 1000, 10)