title: Extracting Data by "html_nodes" with two conditions
body: <p>I'm trying to extract a price list from a particular site</p>
  
  <pre><code>price &lt;- paste0("price", 1:24)
  dfprice &lt;- as.data.frame(price)
  for (i in datalist){
    PanInfos &lt;- html_nodes(i, css = '.info')
  </code></pre>
  
  <p>and when it's a normal price, it's normally extracted in the following way.</p>
  
  <pre><code>  PRICE &lt;- 
      PanInfos %&gt;% 
      html_nodes('.price') %&gt;% 
      html_text()
  
    length(PRICE) &lt;- nrow(dfprice)      
    PRICE &lt;- as.data.frame(PRICE)
    dfprice &lt;- cbind(dfprice, PRICE
  }
  </code></pre>
  
  <p>In general,HTML is consisted like below,</p>
  
  <pre><code>&lt;span class = "price-button"&gt;
     &lt;span itemprop = "price" class = "price"&gt;
  </code></pre>
  
  <p>But when it sale, they give two price text like below</p>
  
  <pre><code>&lt;span class ="now"&gt;
     &lt;span class = "price"&gt;
        &lt;span itemprop="price" class="price"&gt;
  
  &lt;span class = "reduction"&gt;
     &lt;span class = "price"&gt;
        &lt;span itemprop = "price" class="price"&gt;
  </code></pre>
  
  <p>So, when I extract data by html_nodes('.price'), I extract more price information then I need. Like, I have 24 list of Products name, but 25 price information because of that.</p>
  
  <p>To sum up, I'd like to extract the prices at a normal price and discount prices with different conditions. I really need your help.</p>