吾爱破解 - LCG - LSG |安卓破解|病毒分析|www.52pojie.cn

 找回密码
 注册[Register]

QQ登录

只需一步,快速开始

查看: 4820|回复: 18
上一主题 下一主题
收起左侧

[其他转载] python爬虫下载的某网站156个网页小游戏源码

[复制链接]
跳转到指定楼层
楼主
三木猿 发表于 2021-5-26 09:31 回帖奖励
本帖最后由 三木猿 于 2021-6-29 17:35 编辑

有哪些游戏自己看吧↓
一波网页小游戏(摸鱼专用)
https://www.52pojie.cn/thread-1269936-1-1.html
压缩包内有广告,管理员不让发,难受,马上升级了还给我积分撤回了

下载网页小游戏素材版:
[Python] 纯文本查看 复制代码
import requests
from bs4 import BeautifulSoup


def get_Url(url):
    str_list = []
    content = requests.get(url).content
    soup = BeautifulSoup(content, 'lxml')
    find = soup.find('span', attrs={'class': 'current'})
    sum = int(find.text.split('/')[1])
    for i in range(sum):
        if i == 0:
            str_list.append('https://www.mycodes.net/166/')
            continue
        str_list.append('https://www.mycodes.net/166/' + str(i + 1) + '.htm')
    return str_list


def get_document(url):
    soup = BeautifulSoup(requests.get(url).content, 'lxml')
    find_all = soup.find_all('a', attrs={'style': 'color:#006BCD;font-size:14px;'})
    a = ''
    for value in find_all:
        if a.__eq__(str(value['href'])):
            continue
        a = value['href']
        document = BeautifulSoup(requests.get(value['href']).content, 'lxml')
        text = document.find('td', attrs={'class': 'a0'}).text
        print(text+":")
        td_s = document.find_all('td', attrs={'class': 'b4'})
        for td in td_s:
            find = td.find('a')
            if find is not None:
                href_ = 'https://www.mycodes.net' + find['href']
                down = requests.get(href_)
                with open('d:/SanMu/'+text+".zip", "wb") as code:
                    code.write(down.content)
                break



if __name__ == '__main__':
    url_list = get_Url('https://www.mycodes.net/166/')
    for url in url_list:
        get_document(url)

分成了两个包
https://wwi.lanzoui.com/iwGxvgqiwzc
密码:d89r
https://wwi.lanzoui.com/i7WQvgqisqj
密码:dg3j
成品如上
获取在线网址版:
以下是代码
[Python] 纯文本查看 复制代码
import requestsfrom bs4 import BeautifulSoup


def get_Url(url):
    str_list = []
    content = requests.get(url).content
    soup = BeautifulSoup(content, 'lxml')
    find = soup.find('span', attrs={'class': 'current'})
    sum = int(find.text.split('/')[1])
    for i in range(sum):
        if i == 0:
            str_list.append('https://www.mycodes.net/166/')
            continue
        str_list.append('https://www.mycodes.net/166/' + str(i + 1) + '.htm')
    return str_list


def get_document(url):
    soup = BeautifulSoup(requests.get(url).content, 'lxml')
    find_all = soup.find_all('a', attrs={'style': 'color:#006BCD;font-size:14px;'})
    a = ''
    for value in find_all:
        if a.__eq__(str(value['href'])):
            continue
        a = value['href']
        document = BeautifulSoup(requests.get(value['href']).content, 'lxml')
        text = document.find('td', attrs={'class': 'a0'}).text
        print(text+":")
        td_s = document.find_all('td', attrs={'class': 'b1'})
        for td in td_s:
            find = td.find('a')
            if find is not None:
                print(find['href'])


if __name__ == '__main__':
    url_list = get_Url('https://www.mycodes.net/166/')
    for url in url_list:
        get_document(url)

免费评分

参与人数 4吾爱币 +2 热心值 +4 收起 理由
wl21c + 1 + 1 谢谢@Thanks!
yjn866y + 1 + 1 我很赞同!
xuyiyan + 1 鼓励转贴优秀软件安全工具和文档!
lyly125 + 1 用心讨论,共获提升!

查看全部评分

本帖被以下淘专辑推荐:

发帖前要善用论坛搜索功能,那里可能会有你要找的答案或者已经有人发布过相同内容了,请勿重复发帖。

推荐
独特丶小白 发表于 2021-5-26 16:13
哈哈哈,有没有电影网站
推荐
Gaho2002 发表于 2021-5-26 10:34
3#
天可怜见 发表于 2021-5-26 10:50
4#
 楼主| 三木猿 发表于 2021-5-26 10:55 |楼主
天可怜见 发表于 2021-5-26 10:50
楼主,帮忙打包成exe哦,电脑没装python环境

exe就不会了,包链接发出来了
5#
南归不NG 发表于 2021-5-26 11:32
为啥是两个代码?
6#
 楼主| 三木猿 发表于 2021-5-26 11:43 |楼主

一个只取网址,一个下载包
7#
shszss 发表于 2021-5-26 12:03
感谢分享
8#
xuekcd 发表于 2021-5-26 15:12
好高端的技能!
9#
w1hde 发表于 2021-5-26 15:36
没一点 python技术的可以尝试下载不
您需要登录后才可以回帖 登录 | 注册[Register]

本版积分规则 警告:本版块禁止灌水或回复与主题无关内容,违者重罚!

快速回复 收藏帖子 返回列表 搜索

RSS订阅|小黑屋|处罚记录|联系我们|吾爱破解 - LCG - LSG ( 京ICP备16042023号 | 京公网安备 11010502030087号 )

GMT+8, 2024-4-24 23:38

Powered by Discuz!

Copyright © 2001-2020, Tencent Cloud.

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