-2

I want to download a table from a database that contains a set of information in a table format

The website https://membranome.org/species/1

I tried Rcurl,rlist, rvest and jsonlite but i cannot make it for example jsonlite code

a <- fromJSON("https://membranome.org/species/1")

Error: lexical error: invalid char in json text.
                                       <!DOCTYPE html> <html> <head>  
                     (right here) ------^

I want the table of content from the website for data analysis in a data frame format which i can furtherly write and save in csv file format

For example my expected output

Family  protein Name  Protein ID  Localization Topology TM etc
aaaa       bbbb           123        2             152   58 ....
cccc       dddd            234       3              158   60 ....

Thanks in advance

Katrix_02
  • 83
  • 6

1 Answers1

0

rvest might not work on your case since the table is not on the page source. An alternative approach might be using XMLHttpRequests (XHR) to pull json data. Then parse that json into R object (dataframe or list) using json parser package like jsonlite.

Follow this Q/A to get started.

nurandi
  • 1,588
  • 1
  • 11
  • 20