Skip to content Skip to sidebar Skip to footer

Accessing An Html Page Saved Locally On Computer In Python

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.ht

Solution 1:

The raw string prefix only applies to literals. The string is already irreparably damaged, since it is impossible to unilaterally determine without inspection whether the original was supposed to be r'\b' or r'\x08'. All you can do is perform a replace operation and hope you pick the right one.

k = k.replace('\x08', r'\x08')

Post a Comment for "Accessing An Html Page Saved Locally On Computer In Python"