title: Getting response of a form request using scrapy
body: <p>I am using scrapy to send a form request. The data retrieval works in two ways in the browser:</p>
  
  <ol>
  <li>The form is filled in this <a href="http://namis.gov.np/pages/market/marketPriceForm" rel="nofollow noreferrer">page</a></li>
  <li>Form request is sent to this <a href="http://namis.gov.np/site/pages/ajax_priceList" rel="nofollow noreferrer">link</a>.</li>
  </ol>
  
  <p>The response is used to display a data table and a chart in the same page where the form is filled. </p>
  
  <p>Here's the snippet of my spider,</p>
  
  <pre><code>class NamisSpider(scrapy.Spider):
      name = "namis-spider"
      form_url = 'http://namis.gov.np/pages/market/marketPriceForm/'
      request_url = 'http://namis.gov.np/site/pages/ajax_priceList/'
  
      def start_requests(self):
          yield scrapy.Request(url=self.form_url, callback=self.parse)
  
      def parse(self, response):
          token = response.css('input[name="csrf_appcore"]::attr(value)').get()
          data = {
              'csrf_appcore': token,
              'market': '1',
              'category': '1',
              'commodity': '104',
              'date_from': '2075-01-01',
              'date_to': '2076-11-21',
          }
  
          yield scrapy.FormRequest(url=self.request_url, formdata=data, callback=self.parse_market_price)
  
      def parse_market_price(self, response):
          print(response)
  </code></pre>
  
  <p>The response received in the browser after submitting the form is shown
  <a href="https://i.stack.imgur.com/Z9TYS.png" rel="nofollow noreferrer">here</a>. But I'm unable to replicate this using scrapy. The response I get using scrapy is</p>
  
  <pre><code>&lt;200 http://namis.gov.np/site/pages/ajax_priceList/&gt;
  </code></pre>
  
  <p>But I'd like to receive the json response that is received by the browser.</p>
  
  <p>P.S.: The dates are based on Vikram Samvat.</p>