zjzyh

1. 准备

2. 开始工作

import requests
from bs4 import BeautifulSoup

res = requests.get(\'http://jandan.net/ooxx\')
html = BeautifulSoup(res.text, "html.parser")

for index, each in enumerate(html.select(\'img\')):
    with open(\'{}.jpg\'.format(index), \'wb\') as jpg:
        jpg.write(requests.get(each.attrs[\'src\'], stream=True).content)

3.后记

python的库很多,写小工具的时候可以优先考虑python语言。需要什么功能只需要在网上搜索一下,基本上都有相应的模块,至于模块的说明只需要搜索下google,一般的用法基本上都能明白

分类:

技术点:

相关文章:

  • 2021-09-04
  • 2021-06-14
  • 2021-11-30
  • 2021-12-10
  • 2021-12-10
  • 2021-12-08
  • 2022-01-15
  • 2021-11-30
猜你喜欢
  • 2021-11-30
  • 2021-08-23
  • 2021-11-30
  • 2021-11-28
  • 2021-11-23
  • 2021-12-28
  • 2021-06-21
相关资源
相似解决方案