HTML parser
здравейте, с тая задача много се мъча, дава ми нищо а по условие се изпълнява
0/100
https://pastebin.com/qPhgY6WB
1. HTML parser
Write a program that extracts a title of a HTML file and all the content in its body. When you do that print the result in the following format:
"Title: {extracted title}"
"Content: {extracted content}"
The content should be a single string. There might be different tags inside of the body, which you must ignore. You extract only the text without the tags. The input will be on a single line. Example:
"<html>\n<head><title>News</title></head>\n<body><p><a href="https://softuni.bg">Telerik\nAcademy</a>aims to provide free real-world practical\ntraining for young people who want to turn into\nskillful .NET software engineers.</p></body>\n</html>"
Here the title is "News" and the content is "Telerik Academy aims to provide free real-world practical training for young people who want to turn into skillful .NET software engineers."
Examples
Input |
Output |
Comment |
<html>\n<head><title>Some title</title></head>\n<body>Here<p>is some</p>content<a href="www.somesite.com">\nclick</body>\n</html> |
Title: Some title Content: Here is some content click |
We take the title and ignore all the tags to get the content
|
благодаря ти много