0

I am trying to get the data of a table into Google Sheets. The table on the website constantly gets new data added to to the top. (Latest trade data). I am really new to web scraping and HTML code. I'm not even sure if I am looking at the right HTML element or if I should be looking at XPATH for ImportXML.

The URL is: 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>

I have tried both importXML and importHTML, however, I am not sure what each tag is and if I'm using it correctly.

=IMPORTXML("https://www.deribit.com/main#/options?tab=all", "//div[@id='tradesScrollC']/table")

I would like to print all the trade data as it updates on the website, to also print on my google sheet. With column headers exactly like the website (Assets Price IV Qty Date Time)

player0
  • 124,011
  • 12
  • 67
  • 124
user1781336
  • 85
  • 4
  • 12

1 Answers1

0

it is not about formula but website. you will need to find a different one because Google Sheets is not able to scrape JavaScript content. you can check this simply by disabling JS for a given site and you will see a blank page like:

e


this is all you can get:

=ARRAY_CONSTRAIN(IMPORTXML("https://www.deribit.com/main#/options?tab=all", "//*"), 1000, 10)

0


=ARRAY_CONSTRAIN(IMPORTDATA("https://www.deribit.com/main#/options?tab=all"), 1000, 10)

0

Community
  • 1
  • 1
player0
  • 124,011
  • 12
  • 67
  • 124