I am trying to get HTML code from a webpage that is not in the same domain. The html text is parsed & summarises a recipe(recipe name, main ingredients, no. of steps) found
No, this will not work from client-side JavaScript. The browser prevents it for security reasons. You would need to make ajax calls to a local server-side script (PHP, for example) which would then fetch the content (via cURL, for example) and return the HTML you want.