Im writing this program that searches YouTube for a part of a bigger program
when the user inputs the search phrase it might have spaces but i don't want those spaces i want "+" instead so that the URL works
Here is my Code:
import urllib2
x=raw_input("Search: ")
site1 = urllib2.urlopen('http://www.youtube.com/results?search_query=%s'%x)
y = site1.read()
print y
when i input anything that's more than one word it doesn't work because there shouldn't be any spaces in a URL so how can i turn the spaces between words into plus signs
Thank You!