Marzi Heidari
Marzi Heidari

Reputation: 2730

get a json file that a webpage is made of

I'm not familiar with web development but I believe this web page text content https://almath123.github.io/semstyle_examples/ is made of two JSON files mentioned in it (semstyle_results.json and semstyle_results.json) and the JSON files are completely present in ram (If this is the correct term for referring to it) because when I disconnect the internet I can still browse the page and see the text content.

I want to download semstyle_results.json file. Is that possible? how can I do that?

Upvotes: 0

Views: 4636

Answers (2)

punyakoti
punyakoti

Reputation: 19

The webpages may not always show that they will support json or xml return of data. For example if you inspect this webpage SEC EDGAR database using the method described above, it shows no json link but if you append index.json at the end of the link it will return the same data in json format or xml format, if you so please.

i.e: same website but with json endpoint

So it is always a good idea to see if the website hosts developer information. For example SEC EDGAR provides developer tools that mentions that the directory structure can be accessed via HTML, XML or JSON.

SEC developer information

Upvotes: 0

vapurrmaid
vapurrmaid

Reputation: 2307

Technically if you visit a website you're "downloading" the content. Your browser sends a request for information and a server responds by sending you the information. You're viewing that information locally. Dynamic sites poll or make further requests as you browse to keep the data updated and relevant, but it's sent to you.

If you want to easily download any of the content from the website, a simple way is to open up the development tools (CTRL + SHFT + I on windows for Firefox and Chrome), go to a source file and click save as. The network tab shows you requests that were made which includes not just files such as json but also the details of the request.

Here is a screenshot locating one of the json files in a Chrome-based browser (Brave)

json response

Upvotes: 2

Related Questions