2020-03-11


    def star(self,usrName,repoName):
        url = ''.join(['https://github.com/',usrName,'/',repoName,'/'])
        response = self.opener.open(url)
        html = response.read()
        token = self.re_auth.findall(html)[3][41:-3]
        formdata = {'utf-8':'✓','authenticity_token':token}
        data_encoded = urllib.urlencode(formdata)
        response = self.opener.open(url+'star',data_encoded)

你可能感兴趣的:(2020-03-11)