N
N
Nickrex2021-11-26 13:57:54
excel
Nickrex, 2021-11-26 13:57:54

How to transfer real-time dynamic data from a website to Excel?

The site https://finance.yahoo.com/quote/TSLA has dynamic data that changes every n seconds (attached a photo). Tell me how you can automatically transfer real-time data to an Excel spreadsheet?

https://finance.yahoo.com/quote/TSLA - there will be many such links, more than 1000 pieces and only the last prefix will change (TSLA> QQQ> SPY>...). That is, I want to pull up dynamic data from many categories of the site in Excel.

I tried to do it through importXML in a google sheet, but after several updates, the data stops being transmitted.
61a0bd614763c859130413.jpeg

Answer the question

In order to leave comments, you need to log in

3 answer(s)
R
rPman, 2021-11-26
@Nickrex

Welcome to the world of reverse engineering.
In order to collect data from someone else's site, it is necessary to conduct an investigation, for each of them, after each change of the site (sometimes even minimal), repeated (yes, it's easier, but when you have to do it for months ... it becomes not so easy)
in this particular case, the site receives data from server to websocket by link in double encoded form

CgRUU0xBFc18h0QYwJep2qtfKgNOTVMwCDgCRfhlOz5lAHD9P9gBBA==

this is a base64 string, decoded to this
00000000  0a 04 54 53 4c 41 15 66  5a 87 44 18 a0 ba 93 da  |..TSLA.fZ.D.....|
00000010  ab 5f 2a 03 4e 4d 53 30  08 38 02 45 ee 4a ab 3d  |._*.NMS0.8.E.J.=|
00000020  65 00 a8 67 3f d8 01 04                           |e..g?...|

compare different values, try to intuitively decode the format based on the data, or analyze the
ps code a universal way that allows you to almost not do this, but wildly inefficient in terms of computer resources - keep a running browser and use some kind of automation tool (silenium or I like javascript injection , which sends the changed string to my server)
pps you need real-time data on trading instruments, so go to brokers for this information, many give it for free or for cheap (real-time information may require renting a VPS from a broker), more often they charge for historical data

F
ForSureN1, 2021-11-26
@ForSureN1

Welcome to the world of scraping

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question