Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re
- line = input()
- text = line.replace('\\n', "")
- pattern_title = r"<title>(.*)</title>"
- pattern_content = r"\>(.*?\.?)\<"
- title = re.search(pattern_title, text).group(1)
- print(f"Title: {title}")
- matches = re.findall(pattern_content, text)
- print("Content: ", end="")
- for match in matches:
- if match and match != title:
- print(match, end="")
Advertisement
Add Comment
Please, Sign In to add comment