europmc and tidypmc R library for extracting or making metadata from publication
The idea for this code is to first convert PIDs to PMCIDs, then run the tidypmc in a loop over the PMCIDs. The only problem is that tidypmc failed to retrieve tables from most of the IDs in your example list.
library(tidyverse)
library(tidypmc)
library(httr)
library(jsonlite)
example_pids &lt;- c(30024784, 30555165, 30510081, 31688884, 31516032, 28588019, 29286103) %&gt;% as.character()

#-- Convert to PMC ids
convertPIDtoPMCID &lt;- function(pids) {
    #-------- Make API request
    pids4query &lt;- paste(pids, collapse = &quot;%0D%0A&quot;)
    idconv_req &lt;- paste0(&quot;https://www.ncbi.nlm.nih.gov/pmc/utils/idconv/v1.0/?ids=&quot;, pids4query, &quot;&amp;idtype=pmid&amp;format=json&amp;versions=no&amp;showaiid=no&amp;tool=&amp;email=&amp;.submit=Submit&quot;)
    pids_json &lt;- GET(idconv_req) %&gt;% content(&quot;text&quot;) %&gt;% fromJSON()
    #-------- Get info from JSON
    pid2pmc &lt;- pids_json$records %&gt;% 
        select(pmcid, pmid) %&gt;% 
        as.data.frame()
    rownames(pid2pmc) &lt;- pid2pmc$pmid
    pmcids &lt;- pmcids &lt;- pid2pmc[pids, &quot;pmcid&quot;]
    return(pmcids)
}
example_pmcids &lt;- convertPIDtoPMCID(example_pids)

#-- Try to get data with tidypmc
pub_tables &lt;- lapply(example_pmcids, function(pmc_id) {
    message(&quot;-- Trying &quot;, pmc_id, &quot;...&quot;)
    doc &lt;- tryCatch(pmc_xml(pmc_id), 
                    error = function(e) {
                        message(&quot;------ Failed to recover PMCID&quot;)
                        return(NULL)
                        })
    if(!is.null(doc)) { 
        #-- If succeed, try to get table
        tables &lt;- pmc_table(doc)
        if(!is.null(tables)) {
            #-- If succeed, try to get table name
            table_caps &lt;- pmc_caption(doc) %&gt;%
                filter(tag == &quot;table&quot;)
            names(tables) &lt;- paste(table_caps$label, table_caps$text, sep = &quot; - &quot;)
        }
        return(tables) 
    } else {
        #-- If fail, return NA
        return(NA)
    }
})
names(pub_tables) &lt;- example_pids

#-- Inspect results
pub_tables$`30555165`$`Table 1 - Patient demographic and baseline characteristics`
pub_tables$`29286103`$`Table I - Sample summary.`

Tables will require quite a bit of tidying after this. Good luck!