uuSpider.py 文件源码

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

项目:pythonStudy 作者: jeikerxiao 项目源码 文件源码
def post_login(self, response):
        self.logger.info('---- login start ----')
        # ????????????????????? formhash ????, ????????
        formhash = response.xpath('//input[@name="formhash"]/@value').extract()[0]
        self.logger.info('formhash: ' + formhash)
        # FormRequeset.from_response?Scrapy???????, ??post??
        # ?????, ???after_login????
        return [scrapy.FormRequest.from_response(response,
                                          formdata={
                                              'formhash': formhash,
                                              'referer': 'http://www.mayattt.com/index.php',
                                              'loginfield': 'username',
                                              'username': 'mayajeiker',
                                              'password': 'friendship',
                                              'questionid': '0',
                                              'cookietime': '12592000',
                                          },
                                          callback=self.after_login
                                          )]

    # ????????????
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号