上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 24 下一页
摘要: 1、先创建一个虚拟环境: 1、安装虚拟环境模块: -- linux:pip3 install virtualenv -- windows:python -m pip install virtualenv 2、创建虚拟环境(建议虚拟环境统一放在一个目录下) -- virtualenv <环境名-也就是 阅读全文
posted @ 2024-07-01 22:29 little小新 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 注意:有关所有的IO操作都要加上:await 挂起 """ https://dushu.baidu.com/pc/detail?gid=4306063500 #小说网站 https://dushu.baidu.com/api/pc/getCatalog?data={%22book_id%22:%22 阅读全文
posted @ 2024-07-01 22:27 little小新 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 概念:当程序sleep或者input、output等待的时候、cpu是处于堵塞状态的、cpu此时是不再为我们的代码服务的、所以协程就是当遇到了前面这种情况的时候可以选择性的切换到其他任务上 同步协程:asyncio 当程序在睡眠的时候注意加上: await asyncio.sleep(2) """ 阅读全文
posted @ 2024-07-01 22:27 little小新 阅读(1) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2024-07-01 22:27 little小新 阅读(1) 评论(0) 推荐(0) 编辑
摘要: """ 通过第三方的ip去请求 """ import requests #8.130.39.155:3389 proxies = { "https":"http://58.20.248.139:9002", } headers = { "User-Agent":"Mozilla/5.0 (Windo 阅读全文
posted @ 2024-07-01 22:26 little小新 阅读(78) 评论(0) 推荐(0) 编辑
摘要: #会话-cookie的使用 requests.session() """ 先登录网站、找到llogin相关的url 得到cookie、拿到format Data中的信息 带着cookie去请求url 使用cookie去访问(session-会话)该网站其它内容的时候都会带着cookie """ im 阅读全文
posted @ 2024-07-01 22:25 little小新 阅读(3) 评论(0) 推荐(0) 编辑
摘要: 安装:pip install lxml 1、导入:from lxml import etree 2、创建对象: tree = etree.XML(xml文件) tree = etree.HTML(html文件) 等 3、找标签: tree.xpath("//book/name/text()") 4、 阅读全文
posted @ 2024-07-01 22:25 little小新 阅读(21) 评论(0) 推荐(0) 编辑
摘要: beatifulsoup的概念:Beautiful Soup就是Python的一个HTML或XML的解析库,可以用它方便地提取页面的数据。 1、安装bs4:pip install bs4 2、使用:from bs4 import BeautifulSoup 3、创建对象:BeautifulSoup( 阅读全文
posted @ 2024-07-01 22:24 little小新 阅读(2) 评论(0) 推荐(0) 编辑
摘要: 1、查找请求音乐播放的请求 url地址:以酷我音乐为例 拿到url 对url进行分析 :https://www.kuwo.cn/api/v1/www/music/playUrl?mid=326968713&type=music&httpsStatus=1&reqId=bf6ff0b0-acb0-11 阅读全文
posted @ 2024-07-01 22:24 little小新 阅读(12) 评论(0) 推荐(0) 编辑
摘要: 分类: 文本类型数据:txt、csv、execl、数据库 多媒体类型:图片、音乐、视频 """ y音频存储 """ import requests headers = { "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWe 阅读全文
posted @ 2024-07-01 22:23 little小新 阅读(2) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 24 下一页