I am using R for web scraping and I have a script that copies the text of a link and then uses this string to follow the link using RSelenium. Unfortunately this does not seem to work for one particular string when I run the script, but when I replace the saved string with a manually typed string it works fine. A little digging into the html of the page reveals that one of the space characters is actually a character and this is why the string is failing to match. How to I replace with a normal space in R? I have tried using the stringr library and the str_replace command as follows:
var1 <- str_replace(var1, pattern = " ", " ")
But this does not appear to work. Is there anything I am obviously doing wrong? And is there a way to get R to display a string with all the weird formatting characters visible?