代码拉取完成,页面将自动刷新
"""
抓取动态内容
方法1:JavaScript逆向
"""
from concurrent.futures.thread import ThreadPoolExecutor
import requests
def download_picture(url):
resp = requests.get(url)
if resp.status_code == 200:
filename = url[url.rfind('/') + 1:]
with open(f'images/{filename}', 'wb') as file:
file.write(resp.content)
def main():
with ThreadPoolExecutor(max_workers=16) as pool:
for num in range(0, 100, 10):
resp = requests.get(f'https://image.so.com/zjl?ch=beauty&sn={num}&listtype=new&temp=1')
result = resp.json()
for data in result['list']:
pool.submit(download_picture, data['imgurl'])
if __name__ == '__main__':
main()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。