This is a test version of Biostars. For the public version, visit https://www.biostars.org.
get the Therapeutic Uses and Pharmacology and Biochemistry for some CIDs from pubchem in R or python.

How to get the Therapeutic Uses and Pharmacology and Biochemistry inforamtion for a list of CIDs from pubchem in R or python.

examples: The CID is 3372, and the url is as following

https://pubchem.ncbi.nlm.nih.gov/compound/3372#section=Drug-and-Medication-Information

How to get the Therapeutic Uses and Pharmacology and Biochemistry section? Since the web includes javascript, function htmlParse in package XML of R does not work.

Similar question is Parsing Pubchem Compound Records, but I want to get the information from the website directly. Thank you.

cheminformatics pubchem r

1 answer

Is there any reason why you cannot use PubChem PUG ( https://pubchem.ncbi.nlm.nih.gov/pug_rest/PUG_REST_Tutorial.html )? Something like this: https://github.com/zero323/r-snippets/blob/master/R/pubchem_drug_and_medication_information.R should work, although Therapeutic Uses and Pharmacology section seems to be rather loosely structured.

Log in to answer this question.