'How to pragmatically access the results of a website radio button?

I am trying to programatically download the results of a website using wget. This is the website.

I have 500 queries, so I do not want to do this manually. Essentially, I want the table produced from the "Download" button in the right hand side of the table. enter image description here

I tried to get the link that would allow me to download this table by right clicking on the page, going to "Inspect", clicking on the Network tab, and then clicking on the Download button, however the links that came up were not informative.

Does anyone know how I could access the output from this Download button pragmatically?



Solution 1:[1]

I found the answer for this by contacting Gene Expression Atlas directly. This is an example link for a protein which gives the data stored in the download button in JSON format:

https://www.ebi.ac.uk/gxa/json/baseline_experiments?geneQuery=%255B%257B%2522value%2522%253A%2522ENSG00000177455%2522%257D%255D&conditionQuery=&species=homo+sapiens

The website can then be programatically queried via R using functions from the jsonlite package, eg.:

gene_name <- "ENSG00000177455"

url <- paste0(
    "https://www.ebi.ac.uk/gxa/json/baseline_experiments?geneQuery=%255B%257B%2522value%2522%253A%2522",
    gene_name,
    "%2522%257D%255D&conditionQuery=&species=homo+sapiens")

results <- jsonlite::read_json(url)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 icedcoffee