Hi,
I'm brand new to R. In fact, I'm building my first project by copying an article from https://medium.com/@curiositybits/automating-the-google-search-for-the-web-presence-of-8000-organizations-54775e9f6097
However, I'm getting errors and I have no idea how to fix them. I input the following by copying the script from the article and updating with my specifics:
for (name in San_Diego_Foundations$NAME[1:667]){
print(paste0(“finding the url for:”,name))
Sys.sleep(3)
url1 = URLencode(paste0("https://www.bing.com/search?q=",name))
page1 <- read_html(url1)
results1 <- page1 %>% html_nodes(“cite”) %>% html_text()
result1 <- as.character(results1[1])
San_Diego_Foundations[San_Diego_Foundations$NAME==name,]$Website <- result1
}
This is what the console replied:
> for (name in San_Diego_Foundations$NAME[1:667]){
+
+ print(paste0(“finding the url for:”,name))
Error: unexpected input in:
"
print(paste0(“"
>
> Sys.sleep(3)
>
> url1 = URLencode(paste0(“https://www.bing.com/search?q=",name))
Error: unexpected input in " url1 = URLencode(paste0(“"
> page1 <- read_html(url1)
Error in read_html(url1) : could not find function "read_html"
> results1 <- page1 %>% html_nodes(“cite”) %>% html_text()
Error: unexpected input in " results1 <- page1 %>% html_nodes(“"
> result1 <- as.character(results1[1])
Error: object 'results1' not found
>
> San_Diego_Foundations[San_Diego_Foundations$NAME==name,]$Website <- result1
Error: object 'result1' not found
>
> }
Error: unexpected '}' in "}"