Python爬虫使用实例-wallpaper

news2024/9/16 15:52:36

1/ 排雷避坑

🥝 中文乱码问题

print(requests.get(url=url,headers=headers).text)

在这里插入图片描述

出现中文乱码

原因分析:

<meta charset="gbk" />

解决方法:
法一:

response = requests.get(url=url,headers=headers)
response.encoding = response.apparent_encoding # 自动转码, 防止中文乱码
print(response.text)

法二:

print(requests.get(url=url,headers=headers).content.decode('gbk'))

2/ 数据来源

css解析
在这里插入图片描述

for li in lis:
    href = li.css('a::attr(href)').get()
    title = li.css('b::text').get()

    print(href, title)

在这里插入图片描述
在这里插入图片描述
删掉标题为空的那一张图


在这里插入图片描述
获取图片url


有的网站,保存的数据是裂开的图片,可能是因为这个参数:
在这里插入图片描述

3/ 正则处理

处理图片url和标题的时候用了re模块

电脑壁纸
通过匹配非数字字符并在遇到数字时截断字符串

title1 = selector1.css('.photo .photo-pic img::attr(title)').get()
modified_title = re.split(r'\d', title1, 1)[0].strip()

re.split(r'\d', title, 1)将 title 字符串按第一个数字进行分割。返回的列表的第一个元素就是数字前面的部分。strip() 去掉字符串首尾的空白字符。


url图片路径替换,因为从点开图片到达的那个页面无法得到的图片路径还是html页面,不是https://····.jpg,所以替换成另一个可以获取到的页面。

https://sj.zol.com.cn/bizhi/detail_{num1}_{num2}.html

正则替换修改为

https://app.zol.com.cn/bizhi/detail_{num1}.html

例如 https://sj.zol.com.cn/bizhi/detail_12901_139948.html 转换为 https://app.zol.com.cn/bizhi/detail_12901.html .

# https://sj.zol.com.cn/bizhi/detail_12901_139948.html
url = "https://sj.zol.com.cn/bizhi/detail_12901_139948.html"
pattern = r'https://sj\.zol\.com\.cn/bizhi/detail_(\d+)_\d+\.html'
replacement = r'https://app.zol.com.cn/bizhi/detail_\1.html'
new_url = re.sub(pattern, replacement, url)
print(url,new_url)

4/ 电脑壁纸

🥝 单线程单页

适用于当页面和第一页

# python单线程爬取高清4k壁纸图片
import os
import re
import requests
import parsel
url = 'https://pic.netbian.com/4kmeinv/' # 请求地址
# 模拟伪装
headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.139 Safari/537.36'}
# response = requests.get(url=url,headers=headers)
# response.encoding = response.apparent_encoding # 自动转码, 防止中文乱码
# print(response.text)
html_data = requests.get(url=url,headers=headers).content.decode('gbk')
# print(html_data)
selector = parsel.Selector(html_data)
lis = selector.css('.slist li')
for li in lis:
    #href = li.css('a::attr(href)').get()
    title = li.css('b::text').get()
    if title:
        href = 'https://pic.netbian.com' + li.css('a::attr(href)').get()
        response = requests.get(url=href, headers=headers)
        #print(href, title)
        # 这里只是获取页面
        # img_content = requests.get(url=href, headers=headers).content
        # 不可行, 都是同一张图 https://pic.netbian.com/uploads/allimg/230813/221347-16919360273e05.jpg
        href = 'https://pic.netbian.com' + li.css('a::attr(href)').get()
        response1 = requests.get(url=href, headers=headers).content.decode('gbk')
        selector1 = parsel.Selector(response1)
        # 若要标题乱码,此处可不解码
        # response1 = requests.get(url=href, headers=headers)
        # selector1 = parsel.Selector(response1.text)

        # img_url = selector1.css('.slist li img::attr(src)').get()
        # 这一步错了, 要去href页面找img_url, 这是在原来的url页面找了
        img_url = 'https://pic.netbian.com' + selector1.css('.photo .photo-pic img::attr(src)').get()
        img_content = requests.get(url=img_url,headers=headers).content
        # 顺便更新一下title, 因为原来的是半截的, 不全
        title1 = selector1.css('.photo .photo-pic img::attr(title)').get()
        modified_title = re.split(r'\d', title1, 1)[0].strip()
        with open('img\\'+modified_title+'.jpg',mode='wb') as f:
            f.write(img_content)
            #print(href, title)
            print('正在保存:', modified_title, img_url)

🥝 单线程多page

适用于从第二页开始的多页

# python单线程爬取高清4k壁纸图片
import os
import re
import time
import requests
import parsel
# url的规律
# https://pic.netbian.com/new/index.html
# https://pic.netbian.com/new/index_1.html
# https://pic.netbian.com/new/index_2.html
# ...
start_time = time.time()
for page in range(2,10):
    print(f'--------- 正在爬取第{page}的内容 ----------')
    url = f'https://pic.netbian.com/4kmeinv/index_{page}.html'  # 请求地址
    # 模拟伪装
    headers = {
        'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.139 Safari/537.36'}
    # response = requests.get(url=url,headers=headers)
    # response.encoding = response.apparent_encoding # 自动转码, 防止中文乱码
    # print(response.text)
    html_data = requests.get(url=url, headers=headers).content.decode('gbk')
    # print(html_data)
    selector = parsel.Selector(html_data)
    lis = selector.css('.slist li')
    for li in lis:
        # href = li.css('a::attr(href)').get()
        title = li.css('b::text').get()
        if title:
            href = 'https://pic.netbian.com' + li.css('a::attr(href)').get()
            response = requests.get(url=href, headers=headers)
            # print(href, title)
            # 这里只是获取页面
            # img_content = requests.get(url=href, headers=headers).content
            # 不可行, 都是同一张图 https://pic.netbian.com/uploads/allimg/230813/221347-16919360273e05.jpg
            href = 'https://pic.netbian.com' + li.css('a::attr(href)').get()
            response1 = requests.get(url=href, headers=headers).content.decode('gbk')
            selector1 = parsel.Selector(response1)
            # 若要标题乱码,此处可不解码
            # response1 = requests.get(url=href, headers=headers)
            # selector1 = parsel.Selector(response1.text)

            # img_url = selector1.css('.slist li img::attr(src)').get()
            # 这一步错了, 要去href页面找img_url, 这是在原来的url页面找了
            img_url = 'https://pic.netbian.com' + selector1.css('.photo .photo-pic img::attr(src)').get()
            img_content = requests.get(url=img_url, headers=headers).content
            # 顺便更新一下title, 因为原来的是半截的, 不全
            title1 = selector1.css('.photo .photo-pic img::attr(title)').get()
            modified_title = re.split(r'\d', title1, 1)[0].strip()
            with open('img\\' + modified_title + '.jpg', mode='wb') as f:
                f.write(img_content)
                # print(href, title)
                print('正在保存:', modified_title, img_url)

stop_time = time.time()
print(f'耗时:{int(stop_time)-int(start_time)}秒')

运行效果:

在这里插入图片描述
在这里插入图片描述

🥝 多线程多页

# python多线程爬取高清4k壁纸图片
import os
import re
import time
import requests
import parsel
import concurrent.futures

def get_img(url):
    # 模拟伪装
    headers = {
        'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.139 Safari/537.36'}
    # response = requests.get(url=url,headers=headers)
    # response.encoding = response.apparent_encoding # 自动转码, 防止中文乱码
    # print(response.text)
    html_data = requests.get(url=url, headers=headers).content.decode('gbk')
    # print(html_data)
    selector = parsel.Selector(html_data)
    lis = selector.css('.slist li')
    for li in lis:
        # href = li.css('a::attr(href)').get()
        title = li.css('b::text').get()
        if title:
            href = 'https://pic.netbian.com' + li.css('a::attr(href)').get()
            response = requests.get(url=href, headers=headers)
            # print(href, title)
            # 这里只是获取页面
            # img_content = requests.get(url=href, headers=headers).content
            # 不可行, 都是同一张图 https://pic.netbian.com/uploads/allimg/230813/221347-16919360273e05.jpg
            href = 'https://pic.netbian.com' + li.css('a::attr(href)').get()
            response1 = requests.get(url=href, headers=headers).content.decode('gbk')
            selector1 = parsel.Selector(response1)
            # 若要标题乱码,此处可不解码
            # response1 = requests.get(url=href, headers=headers)
            # selector1 = parsel.Selector(response1.text)

            # img_url = selector1.css('.slist li img::attr(src)').get()
            # 这一步错了, 要去href页面找img_url, 这是在原来的url页面找了
            img_url = 'https://pic.netbian.com' + selector1.css('.photo .photo-pic img::attr(src)').get()
            img_content = requests.get(url=img_url, headers=headers).content
            # 顺便更新一下title, 因为原来的是半截的, 不全
            title1 = selector1.css('.photo .photo-pic img::attr(title)').get()
            modified_title = re.split(r'\d', title1, 1)[0].strip()
            img_folder = 'img1\\'
            if not os.path.exists(img_folder):
                os.makedirs(img_folder)
            with open(img_folder + modified_title + '.jpg', mode='wb') as f:
                f.write(img_content)
                # print(href, title)
                print('正在保存:', modified_title, img_url)
def main(url):
    get_img(url)

start_time = time.time()
executor = concurrent.futures.ThreadPoolExecutor(max_workers=5)
for page in range(2, 12):
    print(f'--------- 正在爬取第{page}的内容 ----------')
    url = f'https://pic.netbian.com/4kmeinv/index_{page}.html'  # 请求地址
    executor.submit(main, url)
executor.shutdown()
stop_time = time.time()
print(f'耗时:{int(stop_time) - int(start_time)}秒')

5/ 手机壁纸

类似地,另一个网站,图片集合多页,点开之后里面有多张图片
先试图获取外部的,再获取里面的,然后2个一起

🥝 单线程单页0

import os
import re
import requests
import parsel
url = 'https://sj.zol.com.cn/bizhi/5/' # 请求地址
# 模拟伪装
headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.139 Safari/537.36'}
# response = requests.get(url=url,headers=headers)
# response.encoding = response.apparent_encoding # 自动转码, 防止中文乱码
# print(response.text)
response = requests.get(url=url,headers=headers)
#print(response.text)
selector = parsel.Selector(response.text)
lis = selector.css('.pic-list2 li')
#img_name=1
for li in lis:
    #href = li.css('a::attr(href)').get()
    title = li.css('.pic img::attr(title)').get()
    #href = li.css('.pic img::attr(src)').get()
    #print(title, href)
    if title:
        #href = 'https://sj.zol.com.cn' +li.css('a::attr(href)').get()
        # https://sj.zol.com.cn/bizhi/detail_12901_139948.html
        # https://app.zol.com.cn/bizhi/detail_12901_139948.html#p1
        #href = 'https://app.zol.com.cn' + li.css('a::attr(href)').get() + '#p1'
        href=li.css('img::attr(src)').get()
        #print(href, title)
        #href = 'https://app.zol.com.cn' + li.css('a::attr(href)').get() + '#p1'
        #response1 = requests.get(url=href, headers=headers).content.decode('utf-8')
        #selector1 = parsel.Selector(response1)
        #img_url=selector1.css('.gallery li img::attr(src)').get()
        #print(img_url)
        # 这里只是获取页面
        img_content = requests.get(url=href, headers=headers).content
        # 不可行, 都是同一张图 https://pic.netbian.com/uploads/allimg/230813/221347-16919360273e05.jpg
        # https://sj.zol.com.cn/bizhi/detail_12901_139948.html
        # https://app.zol.com.cn/bizhi/detail_12901_139948.html#p1
        #href= selector1.css('.photo-list-box li::attr(href)').get()
        #href = 'https://app.zol.com.cn' +  + '#p1'
        #response2 = requests.get(url=href, headers=headers)
        #selector2 = parsel.Selector(response2.text)
        #print(href)
        # 若要标题乱码,此处可不解码
        # response1 = requests.get(url=href, headers=headers)
        # selector1 = parsel.Selector(response1.text)

        # img_url = selector1.css('.slist li img::attr(src)').get()
        # 这一步错了, 要去href页面找img_url, 这是在原来的url页面找了
        #img_url = selector1.css('.gallery img::attr(src)').get()
        #img_content = requests.get(url=img_url, headers=headers).content
        #print(img_url)
        # 顺便更新一下title, 因为原来的是半截的, 不全
        # title1 = selector1.css('.photo .photo-pic img::attr(title)').get()
        img_folder = 'img3\\'
        if not os.path.exists(img_folder):
            os.makedirs(img_folder)
        with open(img_folder + title + '.jpg', mode='wb') as f:
            f.write(img_content)
            # print(href, title)
            print('正在保存:', title, href)
        #img_name += 1

🥝 单线程单页1

# 下载子页面全部
import os
import requests
import parsel

url = 'https://app.zol.com.cn/bizhi/detail_12901.html' # 请求地址
# 模拟伪装
headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.139 Safari/537.36'}
response = requests.get(url=url,headers=headers)
selector = parsel.Selector(response.text)
lis = selector.css('.album-list li')
i = 0
for li in lis:
    # Get all img elements within the current li
    img_tags = li.css('img::attr(src)').getall()  # This gets all the img src attributes

    for href in img_tags:  # Iterate over all img src attributes
        img_content = requests.get(url=href, headers=headers).content
        img_folder = 'img4\\'
        if not os.path.exists(img_folder):
            os.makedirs(img_folder)

        with open(img_folder + str(i) + '.jpg', mode='wb') as f:
            f.write(img_content)
            # print(href, i)
            print('正在保存:', i, href)

        i += 1  # Increment i for each image saved

🥝 单线程单页

import os
import re
import requests
import parsel

url = 'https://sj.zol.com.cn/bizhi/5/' # 请求地址
# 模拟伪装
headers = {'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.139 Safari/537.36'}
response = requests.get(url=url,headers=headers)
#print(response.text)
selector = parsel.Selector(response.text)
#lis = selector.css('.pic-list2 li')
# 筛除包含的底部 3个 猜你喜欢
lis=selector.css('.pic-list2 .photo-list-padding')
for li in lis:
    #href = li.css('a::attr(href)').get()
    title = li.css('.pic img::attr(title)').get()
    href = li.css('a::attr(href)').get()
    #print(title, href)
    # https://sj.zol.com.cn/bizhi/detail_12901_139948.html
    #url = "https://sj.zol.com.cn/bizhi/detail_12901_139948.html"
    pattern = r'/bizhi/detail_(\d+)_\d+\.html'
    replacement = r'https://app.zol.com.cn/bizhi/detail_\1.html'
    new_url = re.sub(pattern, replacement, href)
    #print(href, new_url)
    #url = 'https://app.zol.com.cn/bizhi/detail_12901.html'  # 请求地址
    # 模拟伪装
    headers = {
        'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.139 Safari/537.36'}
    response = requests.get(url=new_url, headers=headers)
    selector = parsel.Selector(response.text)
    lis1 = selector.css('.album-list li')
    i = 0
    for li1 in lis1:
        # Get all img elements within the current li
        img_tags = li1.css('img::attr(src)').getall()  # This gets all the img src attributes

        for href in img_tags:  # Iterate over all img src attributes
            img_content = requests.get(url=href, headers=headers).content
            img_folder = 'img5\\'
            if not os.path.exists(img_folder):
                os.makedirs(img_folder)

            with open(img_folder + title+'_'+str(i) + '.jpg', mode='wb') as f:
                f.write(img_content)
                # print(href, i)
                print('正在保存:',title+'_'+str(i), href)

            i += 1  # Increment i for each image saved

在这里插入图片描述

🥝 单线程多页

import os
import re
import requests
import parsel

for page in range(1,3):
    print(f'--------- 正在爬取第{page}的内容 ----------')
    if page==1:
        url = 'https://sj.zol.com.cn/bizhi/5/'  # 请求地址
    else:
        url = f'https://sj.zol.com.cn/bizhi/5/{page}.html'  # 请求地址
    # 模拟伪装
    headers = {
        'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.139 Safari/537.36'}
    response = requests.get(url=url, headers=headers)
    # print(response.text)
    selector = parsel.Selector(response.text)
    # lis = selector.css('.pic-list2 li')
    # 筛除包含的底部 3个 猜你喜欢
    lis = selector.css('.pic-list2 .photo-list-padding')
    for li in lis:
        # href = li.css('a::attr(href)').get()
        title = li.css('.pic img::attr(title)').get()
        href = li.css('a::attr(href)').get()
        # print(title, href)
        # https://sj.zol.com.cn/bizhi/detail_12901_139948.html
        # url = "https://sj.zol.com.cn/bizhi/detail_12901_139948.html"
        pattern = r'/bizhi/detail_(\d+)_\d+\.html'
        replacement = r'https://app.zol.com.cn/bizhi/detail_\1.html'
        new_url = re.sub(pattern, replacement, href)
        # print(href, new_url)
        # url = 'https://app.zol.com.cn/bizhi/detail_12901.html'  # 请求地址
        # 模拟伪装
        headers = {
            'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.139 Safari/537.36'}
        response = requests.get(url=new_url, headers=headers)
        selector = parsel.Selector(response.text)
        lis1 = selector.css('.album-list li')
        i = 0
        for li1 in lis1:
            # Get all img elements within the current li
            img_tags = li1.css('img::attr(src)').getall()  # This gets all the img src attributes

            for href in img_tags:  # Iterate over all img src attributes
                img_content = requests.get(url=href, headers=headers).content
                img_folder = 'img6\\'
                if not os.path.exists(img_folder):
                    os.makedirs(img_folder)

                with open(img_folder + title + '_' + str(i) + '.jpg', mode='wb') as f:
                    f.write(img_content)
                    # print(href, i)
                    print('正在保存:', title + '_' + str(i), href)

                i += 1  # Increment i for each image saved

🥝 多线程多页

import os
import re
import time
import requests
import parsel
import concurrent.futures

def get_imgs(url):
    # 模拟伪装
    headers = {
        'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.139 Safari/537.36'}
    response = requests.get(url=url, headers=headers)
    # print(response.text)
    selector = parsel.Selector(response.text)
    # lis = selector.css('.pic-list2 li')
    # 筛除包含的底部 3个 猜你喜欢
    lis = selector.css('.pic-list2 .photo-list-padding')
    for li in lis:
        # href = li.css('a::attr(href)').get()
        title = li.css('.pic img::attr(title)').get()
        href = li.css('a::attr(href)').get()
        # print(title, href)
        # https://sj.zol.com.cn/bizhi/detail_12901_139948.html
        # url = "https://sj.zol.com.cn/bizhi/detail_12901_139948.html"
        pattern = r'/bizhi/detail_(\d+)_\d+\.html'
        replacement = r'https://app.zol.com.cn/bizhi/detail_\1.html'
        new_url = re.sub(pattern, replacement, href)
        # print(href, new_url)
        # url = 'https://app.zol.com.cn/bizhi/detail_12901.html'  # 请求地址
        # 模拟伪装
        headers = {
            'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/98.0.4758.139 Safari/537.36'}
        response = requests.get(url=new_url, headers=headers)
        selector = parsel.Selector(response.text)
        lis1 = selector.css('.album-list li')
        i = 0
        for li1 in lis1:
            # Get all img elements within the current li
            img_tags = li1.css('img::attr(src)').getall()  # This gets all the img src attributes

            for href in img_tags:  # Iterate over all img src attributes
                img_content = requests.get(url=href, headers=headers).content
                img_folder = 'img7\\'
                if not os.path.exists(img_folder):
                    os.makedirs(img_folder)

                with open(img_folder + title + '_' + str(i) + '.jpg', mode='wb') as f:
                    f.write(img_content)
                    # print(href, i)
                    print('正在保存:', title + '_' + str(i), href)

                i += 1  # Increment i for each image saved

def main(url):
    get_imgs(url)

start_time = time.time()
executor = concurrent.futures.ThreadPoolExecutor(max_workers=4)
for page in range(1, 9):
    #print(f'--------- 正在爬取第{page}的内容 ----------')
    if page == 1:
        url = 'https://sj.zol.com.cn/bizhi/5/'  # 请求地址
    else:
        url = f'https://sj.zol.com.cn/bizhi/5/{page}.html'  # 请求地址
    executor.submit(main, url)
executor.shutdown()
stop_time = time.time()
print(f'耗时:{int(stop_time) - int(start_time)}秒')

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2116348.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

java基础-IO(4)管道流 PipedOutputStream、PipedInputStream、PipedReader、PipedWriter

管道 提到管道&#xff0c;第一印象就是水管或者地下管道&#xff0c;一节接着一节&#xff0c;形如下图。 管道流 "流"从上一个管道 ——-> 下一个管道。又细分为字节流和字符流。 字节流&#xff08;PipedOutputStream、PipedInputStream&#xff09; 如果…

SSM框架介绍

SSM通常指的是三个开源框架的组合&#xff0c;即Spring、SpringMVC&#xff08;Spring Web MVC&#xff09;和MyBatis&#xff0c;这三个框架经常一起使用来开发Java企业级应用&#xff0c;特别是在Web应用开发中非常流行。 SSM框架介绍 Spring 简介&#xff1a;Spring是一个…

谷粒商城のNginx

文章目录 前言一、Nginx1、安装Nginx2、相关配置2.1、配置host2.2、配置Nginx2.3、配置网关 前言 本篇重点介绍项目中的Nginx配置。 一、Nginx 1、安装Nginx 首先需要在本地虚拟机执行&#xff1a; mkdir -p /mydata/nginx/html /mydata/nginx/logs /mydata/nginx/conf在项目…

ModuleNotFoundError: No module named ‘mmcv.transforms‘

不得已的解决方法&#xff1a; mmcv升级到2.0.0即可解决 升级后自然又面临一系列不兼容问题&#xff01; 官方文档查漏补缺

【STM32】呼吸灯实现

对应pwm概念可以去看我的博客51实现的呼吸灯 根据对应图我们可知预分频系数为999&#xff0c;重装载值为2000&#xff0c;因为设置内部时钟晶振频率为100MHZ &#xff0c;1s跳 100 000000次 &#xff0c;跳一次需要1/100 000000s 20ms0.02s 对应跳的次数为 我们使用通用定时器…

九,自定义转换器详细操作(附+详细源码解析)

九&#xff0c;自定义转换器详细操作&#xff08;附详细源码解析&#xff09; 文章目录 九&#xff0c;自定义转换器详细操作&#xff08;附详细源码解析&#xff09;1. 基本介绍2. 准备工作3. 自定义转换器操作4. 自定义转换器的注意事项和细节5. 总结&#xff1a;6. 最后&…

【前端学习】AntV G6-07 深入图形与图形分组、自定义节点、节点动画(上、中)

课程链接 AntV G6&#xff1a;深入图形与图形分组、自定义节点、节点动画&#xff08;上&#xff09;_哔哩哔哩_bilibili AntV G6&#xff1a;深入图形与图形分组、自定义节点、节点动画&#xff08;中&#xff09;_哔哩哔哩_bilibili 图形分组 Group | G6 (antgroup.com) 自…

ARM32开发——DMA内存到内存

&#x1f3ac; 秋野酱&#xff1a;《个人主页》 &#x1f525; 个人专栏:《Java专栏》《Python专栏》 ⛺️心若有所向往,何惧道阻且长 文章目录 需求数据交互流程开发流程依赖引入DMA初始DMA传输请求完整代码 关心的内容DMA初始化DMA初始化DMA数据传输请求完整代码 DMA中断开启…

封装智能指针 qt实现登录界面

1.封装独占智能指针——unique_ptr #include <iostream> #include <utility> // For std::move// 命名空间 namespace custom_memory { template <typename T> class myPtr { public:// 使用初始化列表进行初始化explicit myPtr(T* p nullptr) noexcept : …

卡西莫多的诗文集2022-2024.9月6-校庆国庆专版定版

通过网盘分享的文件&#xff1a;卡西莫多的诗文集2022-2024.9月6-A5-校庆国庆专版-定版.pdf 链接: https://pan.baidu.com/s/1cpFK5k1baGXbSGxY30GL_A?pwdjgnt 提取码: jgnt 卡西莫多的诗文集2022-2024.9月6-校庆国庆专版&#xff0c;又稍作修改并勘误了一些错字&#xff0c;…

AWQ量化(Activation-aware Weight Quantization)

论文&#xff1a; AWQ: Activation-aware Weight Quantization for On-Device LLM Compression and Acceleration 中文解读&#xff1a; 深入理解AWQ量化技术 - 知乎 (zhihu.com) 动机&#xff1a;端侧设备用LLM&#xff0c;为了减少显存占用量&#xff0c;所以要用INT4量化&am…

【Jupyter Notebook】汉化

1.打开:Anaconda Prompt 2.输入:"activate Zhui01"(注意&#xff1a;Zhui01是刚创建的环境名字) activate Zhui01 3.输入:"pip install jupyterlab-language-pack-zh-CN" pip install jupyterlab-language-pack-zh-CN 4.打开:Jupyter Notebook 5.点击&q…

Mysql高级篇(中)——七种常见的 join 查询图

注意&#xff1a; MySQL是不支持 FULL OUTER JOIN 这种语法的&#xff0c;因此要实现图中 6、7的查询结果&#xff0c;可以使用 UNION 关键字结合 LEFT JOIN、RIGHT JOIN 实现&#xff0c;UNION可以实现去重的效果&#xff1b; 参考如下代码&#xff1a; -- MySQL中 图标6 的实…

用Unity2D制作一个人物,实现移动、跳起、人物静止和动起来时的动画:中(人物移动、跳起、静止动作)

上回我们学到创建一个地形和一个人物&#xff0c;今天我们实现一下人物实现移动和跳起&#xff0c;依次点击&#xff0c;我们准备创建一个C#文件 创建好我们点击进去&#xff0c;就会跳转到我们的Vision Studio&#xff0c;然后输入这些代码 using UnityEngine;public class M…

MarginNote 4 激活码 - 苹果电脑(Mac)全能型的阅读工具

对广大求学者来说&#xff0c;如何科学有效地掌握知识&#xff0c;一定是大家不懈追求的方向。 众多求学者使用的&#xff0c;深度阅读学习工具 MarginNote&#xff0c;终于为 Mac 推出了官网 4.0 版。带来了众多创新的学习辅助工具。 MarginNote 4 功能简介 1、快速理清各版…

大数据新视界--大数据大厂之Java 与大数据携手:打造高效实时日志分析系统的奥秘

&#x1f496;&#x1f496;&#x1f496;亲爱的朋友们&#xff0c;热烈欢迎你们来到 青云交的博客&#xff01;能与你们在此邂逅&#xff0c;我满心欢喜&#xff0c;深感无比荣幸。在这个瞬息万变的时代&#xff0c;我们每个人都在苦苦追寻一处能让心灵安然栖息的港湾。而 我的…

探索fastFM:Python中的高效推荐系统库

文章目录 &#x1f680; 探索fastFM&#xff1a;Python中的高效推荐系统库背景&#xff1a;为何选择fastFM&#xff1f;快照&#xff1a;fastFM是什么&#xff1f;安装指南&#xff1a;如何将fastFM加入你的项目&#xff1f;快速入门&#xff1a;五个基础函数的使用实战演练&am…

猫眼电影字体破解(图片转码方法)

问题 随便拿一篇电影做样例。我们发现猫眼的页面数据在预览窗口中全是小方框。在当我们拿到源码以后&#xff0c;数据全是加密后的。所以我们需要想办法破解加密&#xff0c;拿到数据。 破解过程 1.源码获取问题与破解 分析 在我们刚刚请求url的时候是可以得到数据的&#xff…

halcon 由离散点云生成3d模型(2步)

一&#xff0c;创建立方体的3d坐标&#xff0c;定义X,Y,Z坐标 dev_open_window (0, 0, 512, 512, black, WindowHandle) x:[0,0,1,1,0,0,1,1] y:[0,1,1,0,0,1,1,0] z:[0,0,0,0,2,2,2,2] 二&#xff0c;由3创建3d模型&#xff08;在这里是将所有的点集合为一体&#xff09; ge…

多路转接之select(fd_set介绍,参数详细介绍),实现非阻塞式网络通信

目录 多路转接之select 引入 介绍 fd_set 函数原型 nfds readfds / writefds / exceptfds readfds 总结 fd_set操作接口 timeout timevalue 结构体 传入值 返回值 代码 注意点 -- 调用函数 select的参数填充 获取新连接 注意点 -- 通信时的调用函数 添…