|
|
|
|
|
by Jarred
2059 days ago
|
|
For websites that use React, my favorite trick is loading a copy of React Developer Tools inside a headless Chrome instance. From there, you just find the component you want to copy data from and you copy the state or props. Very little string parsing or data formatting required, no malformed data, etc. There's a library floating around on GitHub somewhere that makes loading a simplified version of React Developer Tools inside Puppeteer just a script you eval with a jQuery-like API for selecting React components, but I can't remember the name right now. Someone could probably do this without needing a headless web browser (via jsdom) |
|
I did this with an investment website, where I was able to retrieve all data using simple python. It _should_ be more robust than parsing react components/html.