摘要: #!/usr/bin/python3 import requests import sys import queue import threading class Dirscan(threading.Thread): def __init__(self,q): super(Dirscan, self 阅读全文
posted @ 2020-09-21 21:51 bsde 阅读(349) 评论(0) 推荐(0)
摘要: 写代码之前先看页面分析,找出图片地址的正则表达式 随便找两张图片进行元素分析 <img src="http://pic213.nipic.com/pic/20190419/6970666_050901192080_4.jpg" alt="西藏"> <img src="http://pic215.ni 阅读全文
posted @ 2020-09-18 17:03 bsde 阅读(761) 评论(0) 推荐(0)
摘要: import requestsimport jsonimport _threadimport timedef spider(data): url='https://www.ichunqiu.com/courses/ajaxCourses' headers={'User-agent':'xixi sp 阅读全文
posted @ 2020-09-13 01:05 bsde 阅读(184) 评论(0) 推荐(0)
摘要: import requestsfrom bs4 import BeautifulSoupimport reurl='https://bbs.ichunqiu.com/portal.php'headers={'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win 阅读全文
posted @ 2020-09-12 20:02 bsde 阅读(164) 评论(0) 推荐(0)
摘要: import requestsimport reheaders={'User-Agent':'Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:80.0) Gecko/20100101 Firefox/80.0'}url='https://bbs.ichunq 阅读全文
posted @ 2020-09-11 22:49 bsde 阅读(226) 评论(0) 推荐(0)
摘要: import pymysqlccon=pymysql.connect( host='127.0.0.1', user='root', password='password', port=3306, db='sys', charset='utf8')cur=ccon.cursor()sql='sele 阅读全文
posted @ 2020-09-08 00:52 bsde 阅读(476) 评论(0) 推荐(0)
摘要: 服务端 import socketsever=socket.socket(socket.AF_INET,socket.SOCK_STREAM)host=socket.gethostname()port=1234sever.bind((host,port))sever.listen(5)while T 阅读全文
posted @ 2020-09-06 20:34 bsde 阅读(174) 评论(0) 推荐(0)
摘要: import threadingimport queueclass mythread(threading.Thread): def __init__(self,n): super(mythread, self).__init__() self.n=n def run(self): while not 阅读全文
posted @ 2020-09-03 23:21 bsde 阅读(406) 评论(0) 推荐(0)
摘要: 创建多线程的方法 1.通过_threads模块创建多线程(了解即可): import _threadimport timedef speak(): print('去你大爷')def main():#创建线程函数 _thread.start_new_thread(speak,()) _thread.s 阅读全文
posted @ 2020-09-03 22:56 bsde 阅读(175) 评论(0) 推荐(0)