I am trying to scrape content from LinkedIn using R, but I keep on getting an error when trying to read the HTML content.
This is my code :
install.packages("curl")
library("selectr")
library("xml2")
library("rvest")
library("stringr")
library("curl")
url="https://www.linkedin.com/in/hollyhynes/"
webpage <- read_html(url)
The error is:
Error in open.connection(x, "rb") : HTTP error 999
I tried using the curl
package :
webpage=read_html(curl("https://www.linkedin.com/in/hollyhynes/",handle
= new_handle("useragent" = "Mozilla/5.0")))
but it also returned an error:
Error in open.connection(x, "rb") : HTTP error 999.
In addition: Warning messages:
1: In if (!is.character(x)) x <- structure(as.character(x), names = names(x)) :
closing unused connection 5 (https://www.linkedin.com/in/hollyhynes/)
2: In if (!is.character(x)) x <- structure(as.character(x), names = names(x)) :
closing unused connection 4 (https://www.linkedin.com/in/hollyhynes/)
3: In if (!is.character(x)) x <- structure(as.character(x), names = names(x)) :
closing unused connection 3 (https://www.linkedin.com/in/hollyhynes/)
would appreciate some help on how can I fix it thanks :)