i want names of companies in middle column of this page (written in bold in blue), location indicator of person registering complaint (e.g. "india, delhi", written in green). basically, want table (or data frame) 2 columns, 1 company, , other location. ideas?
you can using xml package in r. here code
url = "http://www.consumercomplaints.in/bysubcategory/mobile-service-providers/page/1.html" doc = htmltreeparse(url, useinternalnodes = t) profiles = xpathsapply(doc, "//a[contains(@href, 'profile')]", xmlvalue) profiles = profiles[!(1:length(profiles) %% 2)] states = xpathsapply(doc, "//a[contains(@href, 'bystate')]", xmlvalue)
Comments
Post a Comment