I am a newbie to Python. I have a HTML file where I need to do some “Find and Replace operation using Regex”. What is the best way to do this?
Can I get the contents of the HTML file as a string and do this? Or is there a better way?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Have a look at a HTML Parser like Beautiful Soup.
Using regex to parse HTML is a bad idea.
Edit:
Beautiful Soup License:
Pythons license