title: How to click a 'submit' button in page with node scraper and then retrieve the page it goes to
body: <p>I am building a scraper in node, but I have gotten stumped. I go to this address: <a href="https://ariisp1.oklahomacounty.org/AssessorWP5/DefaultSearch.asp" rel="nofollow noreferrer">https://ariisp1.oklahomacounty.org/AssessorWP5/DefaultSearch.asp</a> and I want to simulate putting an address in the second textbox and clicking the subsequent 'Submit' button. I can successfully find the textbox and the following button, but I cannot figure out how to simulate the 'click' function and retrieve the url it goes to. There is no href associated with the button because the url it goes to is determined by the address that is put in. Any ideas?</p>
  
  <pre><code>var request = require('request');
  var cheerio = require('cheerio');
  
  
  request.post('https://ariisp1.oklahomacounty.org/AssessorWP5/DefaultSearch.asp', /*{
    form: {
      FormattedLocation: '2333 Nw 32 St'
      //btnSubmit: 'Submit'
    }
  }, */
  function (err, res, body) {
      let $ = cheerio.load(body);
  
  
      $("input[name=FormattedLocation]").text('2331 nw 32 st');
      var x = $("input[name=FormattedLocation]").text();
      var y = $("input[name=FormattedLocation]").next().attr('type');
  
      console.log(y);//successfully gets the 'Submit' button
  
      //code to click button and get the page it goes to goes here
  })
  </code></pre>