Rvest - Adding Column to a Data Frame via web scrape

rvest

#1

I am trying to add the column rev.ratingWLB to the data frame below.

data.frame(rev.date = html_text(html_nodes(pg, ".date.subtle.small, .featuredFlag")),
             rev.sum = html_text(html_nodes(pg, ".reviewLink .summary:not([class*='hidden'])")),
             rev.rating = html_attr(html_nodes(pg, ".gdStars.gdRatings.sm .rating .value-title"), "title"),
             rev.ratingWLB = html_attr(html_nodes(pg, ".gdBars.gdRatings.med. minor([class='Work/Life Balance'])"), "title"),
             rev.title = html_text(html_nodes(pg, "#ReviewsFeed .hideHH")),
             rev.pros = html_text(html_nodes(pg, "#ReviewsFeed .pros:not([class*='hidden'])")),
             rev.cons = html_text(html_nodes(pg, "#ReviewsFeed .cons:not([class*='hidden'])")),
             rev.helpf = html_text(html_nodes(pg, ".tight")),
             stringsAsFactors=F)

Would like to get help on how to accomplish this.
Thank-you!

Below is a snip of HTML for reference to the data frame I'm trying to build.Scrape%20Category%20HTML


#2

I dont see a URL in your post. Am I missing something? :slight_smile:


closed #3

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.