scrapy中发起post请求

    def start_requests(self):
        for i1 in self.start_urls:
            data = {
                'page': '1',
                'rows': '20',
                'annNum': '1678',
                'annType': '',
                'tmType': '',
                'coowner': '',
                'recUserName': '',
                'allowUserName': '',
                'byAllowUserName': '',
                'appId': '',
                'appIdZhiquan': '',
                'bfchangedAgengedName': '',
                'changeLastName': '',
                'transferUserName': '',
                'acceptUserName': '',
                'regName': '',
                'tmName': '',
                'intCls': '',
                'fileType': '',
                'totalYOrN': 'false',
                'appDateBegin': '',
                'appDateEnd': '',
                'agentName': '',
            }
            for i2 in range(1, 13540):
                data['page'] = str(i2)
                yield scrapy.FormRequest(i1, formdata=data, callback=self.parse)
posted @ 2020-01-13 10:22  tulintao  阅读(416)  评论(0编辑  收藏  举报