def __init__(self, url): #https://zhuanlan.zhihu.com/p/20825292 self.originalurl = url number = re.findall(r"(\d+)", url)[0] self.url = "http://zhuanlan.zhihu.com/api/posts/" + str(number) self.headers = headers.copy() self.headers["Host"] = "zhuanlan.zhihu.com"
def __init__(self, item, _xsrf, summary=None): self.item = item self._xsrf = _xsrf self.headers = headers.copy() self.summary = summary
def __init__(self, url): self.url = url self.headers = headers.copy()
def __init__(self, url): self.url = url self.headers = headers.copy() self.headers["Referer"] = self.url
def __init__(self, url, _xsrf=None): self.url = url self.headers = headers.copy() self._xsrf = _xsrf