Jump to content
UBot Underground

Recommended Posts

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 :)

Link to post
Share on other sites

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

Link to post
Share on other sites

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)

  • Like 1
Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...