Skip to content

Instantly share code, notes, and snippets.

@wmcraver
Created January 13, 2017 00:10
Show Gist options
  • Save wmcraver/83030cfe8a08394512e0d54e59d1d55d to your computer and use it in GitHub Desktop.
Save wmcraver/83030cfe8a08394512e0d54e59d1d55d to your computer and use it in GitHub Desktop.
Test Web Scraping
library(rvest)
url2 = read_html("http://www.verticalmeasures.com/measurement-reporting/google-analytics-101-best-practices-for-ecommerce-websites/")
newxpath = as.character('//*+[contains(concat( " ", @class, " " ), concat( " ", "sidebar-widget", " " ))]//*[contains(concat( " ", @class, " " ), concat( " ", "sidebar-widget", " " ))]//ul')
titles = html_nodes(url2, css = "p")
titles = html_text(titles)
titles
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment