I have the following path of HTML page saved in local directory: "C:\Users\Sony\Desktop\b.html". Now I want to search for a word in this page:
url = r"C:\Users\Sony\Desktop\b.html"
page = open(url)
I want to write it as:
k="C:\Users\Sony\Desktop\b.html"
url = r k
page = open(url)
It is giving me error, how to apply read mode r in this case because if I write url=r"k" the k won't be taken as a variable but a string.
I am getting this error:
IOError: [Errno 22] invalid mode ('r') or filename: 'C:\Users\Sony\Desktop\x08.html'