鱼C论坛

 找回密码
 立即注册
查看: 1078|回复: 2

[作品展示] 扒绝对领域妹子图

[复制链接]
发表于 2018-7-20 22:14:50 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能^_^

您需要 登录 才可以下载或查看,没有账号?立即注册

x
扒绝对领域妹子图
慢慢磨出来的0.0勿喷
  1. import requests
  2. import os
  3. from bs4 import BeautifulSoup
  4. def get_img(html):
  5.         soup = BeautifulSoup(html,'html.parser')
  6.         img_list = soup.find_all('img' , class_='dhpic wp-post-image')
  7.         for s_img in img_list:
  8.                 img_url = s_img['src']
  9.                 img_name = img_url.split('/')[-1]
  10.                 img_content = requests.get(img_url).content
  11.                 with open('./img/'+img_name, 'wb') as wf:
  12.                         wf.write(img_content)
  13. def get_comments(url):
  14.         headers = {'user-agent': 'Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/67.0.3396.99 Safari/537.36','referer': 'http://music.163.com/'}
  15.         res = requests.get(url, headers=headers)
  16.         return res

  17. def main():
  18.         page = 4
  19.         if os.path.exists('./img') == False:
  20.                 os.mkdir('./img')
  21.         for each in range(1,page):
  22.                 url = 'https://girlph.com/jdly/page/' + str(each)
  23.                 res = get_comments(url)
  24.                 get_img(res.text)
  25. if __name__ == "__main__":
  26.         main()
复制代码
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复

使用道具 举报

发表于 2018-7-21 02:32:48 | 显示全部楼层
不对吧
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

发表于 2018-7-22 23:30:54 | 显示全部楼层
这个网站好慢啊,打开就很慢
想知道小甲鱼最近在做啥?请访问 -> ilovefishc.com
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

小黑屋|手机版|Archiver|鱼C工作室 ( 粤ICP备18085999号-1 | 粤公网安备 44051102000585号)

GMT+8, 2024-4-20 02:03

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表