code: def start_requests(self):
          
          if self.single_url:
              port = urlparse(self.single_url).port
              if port:
                  if port != self.port:
                      self.port = port
              else:
                  # No need for credentials
                  yield scrapy.Request(
                      self.single_url,
                      callback=self.parse_item,
                      errback=self.handle_error
                  )
                  return
  
          if self.login_email and self.login_password:
              login_url = (
                  URLObject("http://")
                  .with_hostname(self.domain)
                  .with_port(self.port)
                  .with_path(LOGIN_HTML_PATH)
              )
              yield scrapy.Request(
                  login_url,
                  callback=self.after_initial_csrf,
                  errback=self.handle_error
              )
          else:
              self.logger.info(
                  "email/password unset, fetching credentials via auto_auth"
              )
              auth_url = (
                  URLObject("http://")
                  .with_hostname(self.domain)
                  .with_port(self.port)
                  .with_path(AUTO_AUTH_PATH)
                  .set_query_params(
                      staff='true',
                      course_id=self.course_key,
                  )
              )
              # make sure to request a parseable JSON response
              headers = {
                  b"Accept": b"application/json",
              }
              yield scrapy.Request(
                  auth_url,
                  headers=headers,
                  callback=self.after_auto_auth,
                  errback=self.handle_error
              )
docs: Gets the spider started.
          If both `self.login_email` and `self.login_password` are set,
          this method generates a request to login with those credentials.
          Otherwise, this method generates a request to go to the "auto auth"
          page and get credentials from there. Either way, this method
          doesn't actually generate requests from `self.start_urls` -- that is
          handled by the `after_initial_login()` and `after_auto_auth()`
          methods.