samedi 4 janvier 2020

Is there R function for removing row when we do web mining using read_html(url)?

#Specifying the url for desired website to be scraped
url <- 'https://www.goodfirms.co/big-data-analytics/data-science'
#Reading the HTML code from the website
webpage <- read_html(url)
webpage

#Using CSS selectors to scrape the title section
title_data_html <- html_nodes(webpage,'.font18')
#Converting the title data to text
title_data <- html_text(title_data_html)
#Let's have a look at the title
head(title_data)
title_data
length(title_data)

when i checked there is one extra row that is not related with the variable. so, i want to remove the row from my variable. what is the function can be done?




Aucun commentaire:

Enregistrer un commentaire