How to extract reviewer's ratings from Yelp.
<p>I am learning web scraping on my own and I am trying to scrap reviewer's ratings on Yelp as a practice. Typically, I can use CSS selector or XPath methods to select the contents I am interested in. However, those methods do not work for selecting reviewers' ratings. For instance, on the following page: <a href="https://www.yelp.com/user_details_reviews_self?userid=0S6EI51ej5J7dgYz3-O0lA" rel="nofollow">https://www.yelp.com/user_details_reviews_self?userid=0S6EI51ej5J7dgYz3-O0lA</a>. The CSS selector for the first rating is '.stars_2'. However, if I use this selector in my RSelenium code as follows:</p>

<pre><code>     ratings=remDr$findElements('css selector','.stars_2')

     ratings=unlist(lapply(ratings, function(x){x$getElementText()}))
</code></pre>

<p>I get NULL. I think the reason is that the rating is actually a image. I paste a small part of the page source here:</p>

<pre><code>            &lt;div class="review-content"&gt;
            &lt;div class="review-content"&gt;
            &lt;div class="biz-rating biz-rating-very-large clearfix"&gt;
            &lt;div&gt;        
            &lt;div class="rating-very-large"&gt;
            &lt;i class="star-img stars_2" title="2.0 star rating"&gt;
          &lt;img alt="2.0 star rating" class="offscreen" height="303" src="//s3-media4.fl.yelpcdn.com/assets/srv0/yelp_styleguide/c2252a4cd43e/assets/img/stars/stars_map.png" width="84"&gt;
    &lt;/i&gt;
&lt;/div&gt;


    &lt;/div&gt;
</code></pre>

<p>Basically, if I can extract the text from class="stat-img stars_2" or title="2.0 star rating" then I am good. Can anyone help me on this? Please, I really want to know. </p>