25 lines
612 B
Python
25 lines
612 B
Python
# -*- encoding:utf-8 -*-
|
|
|
|
'''
|
|
@Author : dingjiawen
|
|
@Date : 2024/03/26 13:08
|
|
@Usage :
|
|
@Desc :使用pywasm库完成爬取https://spa14.scrape.center/
|
|
'''
|
|
|
|
import time
|
|
import pywasm
|
|
import requests
|
|
|
|
baseurl = 'https://spa14.scrape.center/api/movie/?limit={limit}&offset={offset}&sign={sign}'
|
|
MAX_PAGE = 10
|
|
limit = 10
|
|
runtime = pywasm.load('./Wasm.wasm')
|
|
print(time.time())
|
|
print(type(time.time()))
|
|
for i in range(MAX_PAGE):
|
|
offset = i * limit
|
|
sign = runtime.exec('encrypt', [offset, int(time.time())])
|
|
result = requests.get(baseurl.format(limit=limit, offset=offset, sign=sign))
|
|
print(result.text)
|