title: Read all the values in accordion with the programm R
body: <p>community and happy the new year.
  I tried to extract data from JSTOR and I realized that extracting the selected data only from the current decade. More specifically:
  (view-source:<a href="https://www.jstor.org/journal/annamath" rel="nofollow noreferrer">https://www.jstor.org/journal/annamath</a>)</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;/h2&gt;
  &lt;/div&gt;
  &lt;/div&gt;
  
  &lt;div class="row mtl"&gt;
    &lt;div class="small-12 columns"&gt;
  
      &lt;div class="facets-container"&gt;
        &lt;dl class="facet accordion"&gt;
  
  
  
          &lt;dl class="accordion" data-decade="2020"&gt;
            &lt;dt data-decade="2020" class="expand-arrow" data-filter="AXllYXI6WzIwMjAgVE8gMjAzMH0" data-collection="annamath" aria-expanded="false" aria-controls="decade-2020"&gt;
                      &lt;a aria-label="Clicking this link reveals a list of issues published in the 2020s" class="facet-decade bold" href="/journal/annamath?decade=2020"&gt;2020s&lt;/a&gt;
                  &lt;/dt&gt;
            &lt;dd id="decade-2020" data-decade="2020" style="display: none"&gt;
              &lt;ul data-decade="2020" class="no-bullet list mlm plm background-contain"&gt;
  
  
  
  
                &lt;li data-year="2021"&gt;
                  &lt;span class='year-volume-heading'&gt;2021 (Vol. 194)&lt;/span&gt;
                  &lt;ul data-issues="2021" class="pbxl mll"&gt;
  
                    &lt;li data-doi="10.4007/annamath.194.issue-3" data-sort="2021-11-01t00:00:00z000001940000000000030000000000000000annamath.194.issue-3"&gt;
                      &lt;a href="/stable/10.4007/annamath.194.issue-3"&gt;No. 3 November 2021  pp. 585-982&lt;/a&gt;
                    &lt;/li&gt;
  
                    &lt;li data-doi="10.4007/annamath.194.issue-2" data-sort="2021-09-01t00:00:00z000001940000000000020000000000000000annamath.194.issue-2"&gt;
                      &lt;a href="/stable/10.4007/annamath.194.issue-2"&gt;No. 2 September 2021  pp. 393-584&lt;/a&gt;
                    &lt;/li&gt;
  
                    &lt;li data-doi="10.4007/annamath.194.issue-1" data-sort="2021-07-01t00:00:00z000001940000000000010000000000000000annamath.194.issue-1"&gt;
                      &lt;a href="/stable/10.4007/annamath.194.issue-1"&gt;No. 1 July 2021  pp. 1-392&lt;/a&gt;
                    &lt;/li&gt;
  
                  &lt;/ul&gt;
                &lt;/li&gt;
  
                &lt;li data-year="2021"&gt;
                  &lt;span class='year-volume-heading'&gt;2021 (Vol. 193)&lt;/span&gt;
                  &lt;ul data-issues="2021" class="pbxl mll"&gt;
  
                    &lt;li data-doi="10.4007/annamath.193.issue-3" data-sort="2021-05-01t00:00:00z000001930000000000030000000000000000annamath.193.issue-3"&gt;
                      &lt;a href="/stable/10.4007/annamath.193.issue-3"&gt;No. 3 May 2021  pp. 689-980&lt;/a&gt;
                    &lt;/li&gt;
  
                    &lt;li data-doi="10.4007/annamath.193.issue-2" data-sort="2021-03-01t00:00:00z000001930000000000020000000000000000annamath.193.issue-2"&gt;
                      &lt;a href="/stable/10.4007/annamath.193.issue-2"&gt;No. 2 March 2021  pp. 347-687&lt;/a&gt;
                    &lt;/li&gt;
  
                    &lt;li data-doi="10.4007/annamath.193.issue-1" data-sort="2021-01-01t00:00:00z000001930000000000010000000000000000annamath.193.issue-1"&gt;
                      &lt;a href="/stable/10.4007/annamath.193.issue-1"&gt;No. 1 January 2021  pp. 1-346&lt;/a&gt;
                    &lt;/li&gt;
  
                  &lt;/ul&gt;
                &lt;/li&gt;
  
                &lt;li data-year="2020"&gt;
                  &lt;span class='year-volume-heading'&gt;2020 (Vol. 192)&lt;/span&gt;
                  &lt;ul data-issues="2020" class="pbxl mll"&gt;
  
                    &lt;li data-doi="10.4007/annamath.192.issue-3" data-sort="2020-11-01t00:00:00z000001920000000000030000000000000000annamath.192.issue-3"&gt;
                      &lt;a href="/stable/10.4007/annamath.192.issue-3"&gt;No. 3 November 2020  pp. 679-1070&lt;/a&gt;
                    &lt;/li&gt;
  
                    &lt;li data-doi="10.4007/annamath.192.issue-2" data-sort="2020-09-01t00:00:00z000001920000000000020000000000000000annamath.192.issue-2"&gt;
                      &lt;a href="/stable/10.4007/annamath.192.issue-2"&gt;No. 2 September 2020  pp. 309-678&lt;/a&gt;
                    &lt;/li&gt;
  
                    &lt;li data-doi="10.4007/annamath.192.issue-1" data-sort="2020-07-01t00:00:00z000001920000000000010000000000000000annamath.192.issue-1"&gt;
                      &lt;a href="/stable/10.4007/annamath.192.issue-1"&gt;No. 1 July 2020  pp. 1-307&lt;/a&gt;
                    &lt;/li&gt;
  
                  &lt;/ul&gt;
                &lt;/li&gt;
  
                &lt;li data-year="2020"&gt;
                  &lt;span class='year-volume-heading'&gt;2020 (Vol. 191)&lt;/span&gt;
                  &lt;ul data-issues="2020" class="pbxl mll"&gt;
  
                    &lt;li data-doi="10.4007/annamath.191.issue-3" data-sort="2020-05-01t00:00:00z000001910000000000030000000000000000annamath.191.issue-3"&gt;
                      &lt;a href="/stable/10.4007/annamath.191.issue-3"&gt;No. 3 May 2020  pp. 675-1032&lt;/a&gt;
                    &lt;/li&gt;
  
                    &lt;li data-doi="10.4007/annamath.191.issue-2" data-sort="2020-03-01t00:00:00z000001910000000000020000000000000000annamath.191.issue-2"&gt;
                      &lt;a href="/stable/10.4007/annamath.191.issue-2"&gt;No. 2 March 2020  pp. 329-674&lt;/a&gt;
                    &lt;/li&gt;
  
                    &lt;li data-doi="10.4007/annamath.191.issue-1" data-sort="2020-01-01t00:00:00z000001910000000000010000000000000000annamath.191.issue-1"&gt;
                      &lt;a href="/stable/10.4007/annamath.191.issue-1"&gt;No. 1 January 2020  pp. 1-328&lt;/a&gt;
                    &lt;/li&gt;
  
                  &lt;/ul&gt;
                &lt;/li&gt;
  
  
  
              &lt;/ul&gt;
            &lt;/dd&gt;
          &lt;/dl&gt;
  
  
  
          &lt;dl class="accordion" data-decade="2010"&gt;
            &lt;dt data-decade="2010" class="expand-arrow" data-filter="AXllYXI6WzIwMTAgVE8gMjAyMH0" data-collection="annamath" aria-expanded="false" aria-controls="decade-2010"&gt;
                      &lt;a aria-label="Clicking this link reveals a list of issues published in the 2010s" class="facet-decade bold" href="/journal/annamath?decade=2010"&gt;2010s&lt;/a&gt;
                  &lt;/dt&gt;
            &lt;dd id="decade-2010" data-decade="2010" style="display: none"&gt;
              &lt;ul data-decade="2010" class="no-bullet list mlm plm background-contain"&gt;
  
              &lt;/ul&gt;
            &lt;/dd&gt;
          &lt;/dl&gt;</code></pre>
  </div>
  </div>
  </p>
  <p>the code that I use is:</p>
  <pre><code>library(tidyverse)
  library(rvest)
  library(httr)
      url &lt;- &quot;https://www.jstor.org/journal/annamath&quot;
      
      accordion_url &lt;-        url %&gt;%
                              read_html(url) %&gt;%
                              html_element(&quot;dl.accordion &quot;)
      
      core&lt;-tibble(
              volumes=accordion_url%&gt;%html_elements(&quot;span.year-volume-heading&quot;)%&gt;%html_text(),
              data=   accordion_url%&gt;%
                      html_elements(&quot;ul.pbxl.mll&quot;)%&gt;%
                      map(~ html_elements(.x,&quot;li&quot;)%&gt;%
                      html_text2()),
              
      ) %&gt;%
              unnest(data) %&gt;%
              separate(
                      data,
                      into = c(&quot;issues&quot;),
                      sep = &quot;: &quot;
                      ) 
      core$links&lt;-paste0(&quot;https://www.jstor.org&quot;,url %&gt;%read_html(url) %&gt;%html_nodes(&quot;ul.pbxl.mll a&quot;) %&gt;% html_attr(&quot;href&quot;),sep=&quot;&quot;)
  </code></pre>
  <p>The situation here is that I can't think of a way in R to web scrapping from JSTOR and the other information from the decades.</p>