def process_item(self, item, spider):
config_file = write_pa11y_config(item)<EOL>args = [<EOL>self.pa11y_path,<EOL>item["<STR_LIT:url>"],<EOL>'<STR_LIT>'.format(file=config_file.name),<EOL>]<EOL>for flag, value in self.cli_flags.items():<EOL><INDENT>args.append("<STR_LIT>".format(flag=flag, value=value))<EOL><DEDENT>retries_remaining = <NUM_LIT:3><EOL>while retries_remaining:<EOL><INDENT>logline = "<STR_LIT:U+0020>".join(args)<EOL>if retries_remaining != <NUM_LIT:3>:<EOL><INDENT>logline += u"<STR_LIT>".format(num=<NUM_LIT:3>-retries_remaining)<EOL><DEDENT>spider.logger.info(logline)<EOL>proc = sp.Popen(<EOL>args, shell=False,<EOL>stdout=sp.PIPE, stderr=sp.PIPE,<EOL>)<EOL>stdout, stderr = proc.communicate()<EOL>if proc.returncode in (<NUM_LIT:0>, <NUM_LIT:2>):<EOL><INDENT>break<EOL><DEDENT>else:<EOL><INDENT>retries_remaining -= <NUM_LIT:1><EOL><DEDENT><DEDENT>if retries_remaining == <NUM_LIT:0>:<EOL><INDENT>raise DropItem(<EOL>u"<STR_LIT>".format(<EOL>url=item['<STR_LIT:url>'],<EOL>err=stderr,<EOL>)<EOL>)<EOL><DEDENT>pa11y_results = load_pa11y_results(stdout, spider, item['<STR_LIT:url>'])<EOL>check_title_match(item['<STR_LIT>'], pa11y_results, spider.logger)<EOL>track_pa11y_stats(pa11y_results, spider)<EOL>os.remove(config_file.name)<EOL>write_pa11y_results(item, pa11y_results, Path(spider.data_dir))<EOL>return item<EOL>
Use the Pa11y command line tool to get an a11y report.