上一页 1 ··· 3 4 5 6 7 8 9 10 下一页
摘要: import time from selenium.webdriver import Edge from selenium.webdriver.common.by import By from selenium.webdriver.common.keys import Keys # 键盘输入 # 1 阅读全文
posted @ 2023-03-05 19:53 0x1e61 阅读(32) 评论(0) 推荐(0)
摘要: # 不用协程 """ import os import asyncio import requests import aiofiles as aiofiles from lxml import etree import aiohttp headers = { 'User-Agent': 'Mozil 阅读全文
posted @ 2023-03-04 00:56 0x1e61 阅读(86) 评论(0) 推荐(0)
摘要: import requests from lxml import etree url = 'https://changsha.zbj.com/xcxkfzbjzbj/f.html?fr=zbj.sy.zyyw_2nd.lv3&r=2' headers = { 'User-Agent': 'Mozil 阅读全文
posted @ 2023-03-03 23:56 0x1e61 阅读(34) 评论(0) 推荐(0)
摘要: # request.get() 同步的代码 -> 异步操作aiohttp import os # 异步io import asyncio # 异步file import aiofiles # 异步 http import aiohttp # 如果文件夹不存在则创建文件夹,用来放图片 if not o 阅读全文
posted @ 2023-03-03 23:09 0x1e61 阅读(24) 评论(0) 推荐(0)
摘要: import asyncio import time # 协程(Coroutine),也可以被称为微线程,是一种用户态内的上下文切换技术。 # 简而言之,其实就是通过一个线程实现代码块相互切换执行 # asyncio是Python 3.4版本引入的标准库,直接内置了对异步IO的支持。 # async 阅读全文
posted @ 2023-03-03 22:52 0x1e61 阅读(20) 评论(0) 推荐(0)
摘要: import csv import time from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor import requests # 存储文件 f = open('data.csv', mode='w', en 阅读全文
posted @ 2023-03-03 21:50 0x1e61 阅读(22) 评论(0) 推荐(0)
摘要: from multiprocessing import Process def task(name): for i in range(10000): print(f"{name}:",i) if __name__ == '__main__': p = Process(target=task,args 阅读全文
posted @ 2023-03-03 20:44 0x1e61 阅读(11) 评论(0) 推荐(0)
摘要: # 线程类 from threading import Thread def func(): for i in range(1000): print("func", 1) if __name__ == '__main__': t = Thread(target=func) # 创建线程并给线程安排任 阅读全文
posted @ 2023-03-03 20:37 0x1e61 阅读(12) 评论(0) 推荐(0)
摘要: import requests # 使用代理获取百度首页 headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/110.0. 阅读全文
posted @ 2023-03-03 19:43 0x1e61 阅读(23) 评论(0) 推荐(0)
摘要: import requests url = 'https://www.xread8.com/user/login.json' headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 阅读全文
posted @ 2023-03-03 14:11 0x1e61 阅读(20) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 下一页