holerite.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:cmc-transparencia-spider 作者: CodeForCuritiba 项目源码 文件源码
def parse_dates(self, response):
        """
        The data is organized by dates, the spider will
        get the entire year relative data
        """
        for date in response.css('select[name="mesano"] option'):
            mesano = date.css('::attr(value)').extract_first()

            if re.search(r"(\d{4})", mesano).group(1) == time.strftime("%Y"):

                request = scrapy.FormRequest(
                    url=BASE_URL + 'holerite/index.html',
                    formdata={
                        'acao': '',
                        'grupo': GRUPO,
                        'mesano': mesano,
                        'tipo': '1'
                    },
                    callback=self.parse_entities
                )

                request.meta['mesano'] = mesano

                yield request
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号