示例#1
0
 def _web_parsing_callback(parsed_page: dict):
     """
     The callback function of crawler.
     This method writes the parsed pages in a json file
     :param parsed_page: The parsed page
     """
     JsonSerializer.add_item_to_dict(parsed_page.get('url'), parsed_page, job.json_file)
示例#2
0
 def _sniffer_callback(pkt: dict):
     """
     The callback function of packet sniffer.
     This method writes the sniffed packets in a json file
     :param pkt: The sniffed packet
     """
     JsonSerializer.add_item_to_dict(pkt['number'], pkt, job.json_file)