Added function to extract contents from html