title: How do I extract data from a website using javascript.
body: <p>Hi complete newbie here so bear with me. Seems like a simple job but I can't seem to find an easy way to do this. </p>
  
  <p>So I need to extract a particular text from a webpage "www.example.com/index.php". I know that the text would be available in p tag with certain id. How do I extract this data out using javascript?</p>
  
  <p>What I'm trying currently is that I have my javascript file (trying.js) on my computer with the following code:</p>
  
  <pre><code>$(document).ready(function () {
      $.get("www.example.com/index.php", function(data) {
          console.log(data)
      }) ;
  });
  </code></pre>
  
  <p>and a html that runs the javascript file. </p>
  
  <p>When I open this html page with firefox it doesn't show me anything in console. How do I get the website's data? Am I on the correct track here? Is there a better way to do this?</p>