I am using rvest package to extract information from a website in french with accents.
i've tried different encoding methods in my read_hmtl() function, latin1, latin8, utf-8 but all failed.
On top of code source page :
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
Here is my code :
dnc_avis <- read_html(url, encoding = "utf8")
df <- data.frame(dnc_avis %>% html_nodes("div .contenant_recherche h3") %>% html_text(trim=TRUE))
df[1,]
it gives me : Monsieur René (for Monsieur René).
also tried :
dnc_avis <- read_html(iconv(url, to = "UTF-8"), encoding = "utf8")
but same output.
How can I get a right encoding ?
thanks a lot.