code: def scrape_document(self, item_session: ItemSession):
          '''Process document for links.'''
          self.event_dispatcher.notify(
              PluginFunctions.get_urls, item_session
          )
  
          if not self._document_scraper:
              return
  
          demux_info = self._document_scraper.scrape_info(
              item_session.request, item_session.response,
              item_session.url_record.link_type
          )
  
          num_inline_urls = 0
          num_linked_urls = 0
  
          for scraper, scrape_result in demux_info.items():
              new_inline, new_linked = self._process_scrape_info(
                  scraper, scrape_result, item_session
              )
              num_inline_urls += new_inline
              num_linked_urls += new_linked
  
          _logger.debug('Candidate URLs: inline={0} linked={1}',
                        num_inline_urls, num_linked_urls
          f scrape_document(self, item_session: ItemSession):
          '''Process document for links.'''
          self.event_dispatcher.notify(
              PluginFunctions.get_urls, item_session
          )
  
          if not self._document_scraper:
              return
  
          demux_info = self._document_scraper.scrape_info(
              item_session.request, item_session.response,
              item_session.url_record.link_type
          )
  
          num_inline_urls = 0
          num_linked_urls = 0
  
          for scraper, scrape_result in demux_info.items():
              new_inline, new_linked = self._process_scrape_info(
                  scraper, scrape_result, item_session
              )
              num_inline_urls += new_inline
              num_linked_urls += new_linked
  
          _logger.debug('Candidate URLs: inline={0} linked={1}',
                        num_inline_urls, num_linked_urls
          )
docs: Process document for links.