随笔分类 - python库
摘要:# 端口扫描工具 TCP模式-socket 原理 目标主机的一个端口如果是监听状态(LISTENING或者LINSTEN),那么当我connect目标主机时就能成功,否则说明端口是关闭的。 优点: 编程简单,是需要一个API connect(),比较可靠,因为TCP是可靠协议,当丢包的时候,会重传
阅读全文
摘要:https://www.cnblogs.com/fengf233/p/10880782.html
阅读全文
摘要:python解析常用库的语法 xpath Beautifulsoup ''' html_doc = """ <html> <head> <title>The Dormouse's story</title> </head> <body> <p class="title aq"> <b> The Do
阅读全文
摘要:import os import time import shutil def del_file(filepath): """ 删除某一目录下的所有文件或文件夹 """ del_list = os.listdir(filepath) for f in del_list: file_path = os
阅读全文
摘要:GET参数实例 requests.get('http://www.dict.baidu.com/s', params={'wd': 'python'}) #或 url = 'http://www.baidu.com' payload = {'key1': 'value1', 'key2': 'val
阅读全文
摘要:安装 pip install fake-useragent 使用 from fake_useragent import UserAgent ua = UserAgent() #print(ua.chrome) headers= {'User-Agent':ua.random} r = request
阅读全文