摘要:
import requestsfrom lxml.etree import HTMLimport timeimport osfrom multiprocessing.dummy import Poolimport sysfrom fake_useragent import UserAgentsys. 阅读全文
posted @ 2021-03-28 14:38
mjth
阅读(238)
评论(0)
推荐(0)
摘要:
'''IO多路复用I/O(input/output),即输入/输出端口。每个设备都会有一个专用的I/O地址,用来处理自己的输入输出信息首先什么是I/O: I/O分为磁盘io和网络io,这里说的是网络io IO多路复用: I/O多路复用指:通过一种机制,可以监视多个描述符(socket),一旦某个描述 阅读全文
posted @ 2021-03-28 14:33
mjth
阅读(710)
评论(0)
推荐(0)
摘要:
#环境安装: pip install aiohttp#使用该模块中的ClientSessionimport requestsimport asyncioimport aiohttpimport timestar=time.time()urls=[ 'http://127.0.0.1:5000/bob 阅读全文
posted @ 2021-03-28 14:31
mjth
阅读(236)
评论(0)
推荐(0)
摘要:
import requestsimport json url = 'https://search.lionairthai.com/SL/Flight.aspx/GetFlightSearch'headers = {'accept': 'application/json, text/javascrip 阅读全文
posted @ 2021-03-28 14:30
mjth
阅读(170)
评论(0)
推荐(0)
摘要:
#http://www.ttshitu.com/price.html?spm=nullimport base64import jsonimport requests def base64_api(uname, pwd, img): with open(img, 'rb') as f: base64_ 阅读全文
posted @ 2021-03-28 14:28
mjth
阅读(144)
评论(0)
推荐(0)
摘要:
a=[8,88,11,22,11]for i in range(len(a)-1,0,-1): for b in range(i): if a[b]>a[b+1]: a[b],a[b+1]=a[b+1],a[b] print(a) def bublle_sort(alist): """冒泡排序""" 阅读全文
posted @ 2021-03-28 14:25
mjth
阅读(148)
评论(0)
推荐(0)
摘要:
import requestsimport reimport jsonfrom lxml.etree import HTMLfrom multiprocessing.dummy import Poolurl='https://www.pearvideo.com/category_5'session= 阅读全文
posted @ 2021-03-28 14:24
mjth
阅读(302)
评论(0)
推荐(0)
摘要:
#使用单线程串行方法执行import timedef get_page(str): time.sleep(2) print('正在下载:',str)name=['qwe','est','sdsaa','g56']start_time=time.time()for i in range(len(nam 阅读全文
posted @ 2021-03-28 14:23
mjth
阅读(51)
评论(0)
推荐(0)
摘要:
USER_AGENTS = ["Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; AcooBrowser; .NET CLR 1.1.4322; .NET CLR 2.0.50727)","Mozilla/4.0 (compatible; 阅读全文
posted @ 2021-03-28 14:21
mjth
阅读(147)
评论(0)
推荐(0)
摘要:
from selenium import webdriverfrom time import sleepbro = webdriver.Chrome()bro.get('https://www.taobao.com/')#标签定位search_input = bro.find_element_by_ 阅读全文
posted @ 2021-03-28 14:20
mjth
阅读(66)
评论(0)
推荐(0)
摘要:
from selenium import webdriverfrom lxml.etree import HTMLfrom time import sleep#导入动作链对应的类from selenium.webdriver import ActionChains bro = webdriver.C 阅读全文
posted @ 2021-03-28 14:19
mjth
阅读(49)
评论(0)
推荐(0)
摘要:
from selenium import webdriverfrom time import sleepbro = webdriver.Chrome()bro.get('https://mail.qq.com/')sleep(1)bro.switch_to_frame('login_frame')s 阅读全文
posted @ 2021-03-28 14:18
mjth
阅读(39)
评论(0)
推荐(0)
摘要:
import timefrom selenium import webdriver#无可视化from selenium.webdriver.chrome.options import Options#规避检测from selenium.webdriver import ChromeOptions d 阅读全文
posted @ 2021-03-28 14:17
mjth
阅读(67)
评论(0)
推荐(0)
摘要:
import xlwt,xlrdimport openpyxlimport xlrdimport pymysqlimport xlrdimport pymysqlfname = "zongshujv.xls"bk = xlrd.open_workbook(fname)#shprint(bk)##sh 阅读全文
posted @ 2021-03-28 14:16
mjth
阅读(96)
评论(0)
推荐(0)
摘要:
import xlwt,xlrdimport openpyxlimport xlrdimport pymysqlimport xlrdimport pymysqlfname = "zongshujv.xls"bk = xlrd.open_workbook(fname)#shprint(bk)##sh 阅读全文
posted @ 2021-03-28 14:14
mjth
阅读(94)
评论(0)
推荐(0)
摘要:
import xlrdimport pymysqlfname = "LAX0412.xls"bk = xlrd.open_workbook(fname)print(bk) try: sh = bk.sheet_by_index(0)except: print("////") nrows = sh.n 阅读全文
posted @ 2021-03-28 14:13
mjth
阅读(73)
评论(0)
推荐(0)

浙公网安备 33010602011771号