SyntaxFix
Write A Post
Hire A Developer
Questions
You can use the re module for regexes, but regexes are probably overkill for what you want. I might try something like
re
z.write(article[:article.index("</html>") + 7]
This is much cleaner, and should be much faster than a regex based solution.