Asentrix 17 Posted May 24, 2015 Report Share Posted May 24, 2015 I'm trying to scrape usernames off of youtube , add them to a list , and save their name as a .html file.Now the problem is , sometimes people have lots of spaces in their names , which messes up the html file.. Is there a way to scrape their names using regex and replace the spaces with a special character , such as a dash?? Eg. -Any help is appreciated Quote Link to post Share on other sites
Asentrix 17 Posted May 24, 2015 Author Report Share Posted May 24, 2015 Solved this , here's an example for future reference. set(#names, $replace($scrape attribute(<class="user-name g-hovercard">, "innertext"), " ", "-"), "Global") Using the command "Set" I created a new variable , I set the value to replace and usernames it scrapes , and change the spaces to - symbols Quote Link to post Share on other sites
HelloInsomnia 1103 Posted May 24, 2015 Report Share Posted May 24, 2015 Just so you know represents a space in HTML so if you need to display a space instead of a dash you can probably use that character (just keep in mind its there so you wouldn't want to save their names like that but replace that back with a space when saving to a file if that makes sense) 1 Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.