除了使用phantomjs,selenium之外,怎么爬取多页评论,这两个都太慢了。例如http://music.163.com/#/song?i... 的 评论。
webapi都是http://music.163.com/weapi/v1...,
每页20个评论,怎么获取下一页的评论,param是加密的,post都不知道post什么数据
在网上有一种方式只能获取
def aes_encrypt(self, text, secKey):
pad = 16 - len(text) % 16
text = text + pad * chr(pad)
encryptor = AES.new(secKey, 2, '0102030405060708')
ciphertext = encryptor.encrypt(text)
ciphertext = base64.b64encode(ciphertext)
return ciphertext
def rsa_encrypt(self, text, pubKey, modulus):
text = text[::-1]
rs = int(text.encode('hex'), 16) ** int(pubKey, 16) % int(modulus, 16)
return format(rs, 'x').zfill(256)
def create_secret_key(self, size):
return (''.join(map(lambda xx: (hex(ord(xx))[2:]), os.urandom(size))))[0:16]
d