title: How can I extract data using xpath and the rvest function html_nodes()?
body: <p>I'm web-scraping using the R package rvest. I don't get an error, but instead, my code captures an <em>empty character</em> in the environment.</p>
  <p><strong>My code:</strong></p>
  <pre><code>amore_tomato_page &lt;- &quot;https://thrivemarket.com/p/amore-tomato-paste&quot;
  amore_tomato &lt;- read_html(amore_tomato_page)
  amore_tomato_body &lt;- amore_tomato %&gt;%
    html_node(&quot;body&quot;) %&gt;%
    html_children()
  
  allergens &lt;- amore_tomato %&gt;%
    html_nodes(xpath = '/html/body/div[1]/div[2]/div[4]/div[6]/div/div[1]/section/div/div/div/div/div[2]/div[2]/p[2]') %&gt;%
    html_attr()
  
  ingredients &lt;- amore_tomato %&gt;%
    html_nodes(xpath = '/html/body/div[1]/div[2]/div[4]/div[6]/div/div[1]/section/div/div/div/div/div[2]/div[1]/p') %&gt;%
    html_attr()
  </code></pre>
  <p>I'm trying to extract allergen information and ingredients for the product (and hundreds of products).</p>
  <p>Thank you in advance for your help troubleshooting this!</p>
  <p>Best, <br>
  ~Mayra</p>