HTML parsing in java
1 Answer
HTML parsing in java
| Flag | PURGE
Hi,
In an interview, asked to return list of all the tags that contain a label. So, I am given a html page and function has argument labelToFind , which return all the tags that contain that label. How should I do that?
I thought of storing the complete html page as tree structure and then I can do it. But I am not allowed to use external library and I am not very sure how to correctly parse html in java and store it?
Thanks
Ravi
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
Email me when people comment.
Email me when people comment.
Loading...
An error occurred in subscribing you.
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.
I have managed to parse the HTML with some regex and create a tree. Now the question of return list of all tags that contains a particular label. I was thinking of doing post order traversal and but not a defined approach in my head. Any suggestions?
- ravikisan82 March 05, 2014