title: How to submit a form in scrapy?
body: <p>I tried to use scrapy to complete the login and collect my project commit count. And here is the code.</p>
  
  <pre><code>from scrapy.item import Item, Field
  from scrapy.http import FormRequest
  from scrapy.spider import Spider
  from scrapy.utils.response import open_in_browser
  
  
  class GitSpider(Spider):
      name = "github"
      allowed_domains = ["github.com"]
      start_urls = ["https://www.github.com/login"]
  
      def parse(self, response):
          formdata = {'login': 'username',
                  'password': 'password' }
          yield FormRequest.from_response(response,
                                          formdata=formdata,
                                          clickdata={'name': 'commit'},
                                          callback=self.parse1)
  
      def parse1(self, response):
          open_in_browser(response)
  </code></pre>
  
  <p>After running the code</p>
  
  <pre><code>scrapy runspider github.py
  </code></pre>
  
  <p>It should show me the result page of the form, which should be a failed login in the same page as the username and password is fake. However it shows me the <a href="https://github.com/search" rel="noreferrer">search page</a>. The log file is located in <a href="http://pastebin.com/0gRaNm7D" rel="noreferrer">pastebin</a></p>
  
  <p>How should the code be fixed? Thanks in advance.</p>