What is a parser and what does it do?
For example, what would an HTML parser do in python?

They're special functions designed to make your life EASIER for reading and writing, in this example, HTML.

They're special functions designed to make your life EASIER for reading and writing, in this example, HTML.

Paser can thought of a computer program whch is used to translate one form of information to another form of information.

Thanks,
Maniraj Patri

Parsing often means "perform syntax analysis" on a program or a text. It means check if a text obeys given grammar rules and extract the corresponding information. For example, suppose that you define the rule that the structure of a question in english is auxiliary verb + subject + main verb + rest . Then the output of the statement parse("Are they playing football?") could be a hierarchy of tuples, or other objects, like this

("question",
    ("auxiliary verb", "are"),
    ("subject", "they"),
    ("verb", "playing"),
    ("rest", "football"),
)

Programs and compilers handle such trees more easily than raw text.

Comments
Thanks a lot
This question has already been answered. Start a new discussion instead.