crac

导航

随笔分类 -  python

1 2 3 下一页

python常用
摘要:获取当前时间 def getNowTime(): currenttime=datetime.datetime.now() res=currenttime.strftime("%Y_%m_%d") return res 时间戳转换: def datetime_timestamp(dt): dt=dt. 阅读全文

posted @ 2020-07-31 16:17 crac 阅读(156) 评论(0) 推荐(0)

selenium的browser.page_source无法返回页面内容
摘要:selenium的browser.page_source无法返回页面内容 可能是编码的问题。。 另外:元素内容直接获取: 阅读全文

posted @ 2018-09-26 01:39 crac 阅读(902) 评论(0) 推荐(0)

imgtobase64
摘要:# -*- coding: utf-8 -*- import re import base64 from cStringIO import StringIO from PIL import Image def base64_to_image(base64_str, image_path=None): 阅读全文

posted @ 2018-09-25 14:20 crac 阅读(509) 评论(0) 推荐(0)

使用百度ocr接口识别验证码
摘要:#!/usr/bin/env python #created by Baird from aip import AipOcr def GetCaptchaV(filename): APP_ID = '1X4X8X4X' API_KEY = 'YaVcqamctoYqRHNGAqwVbn97UO' SECRET_KEY = 'C1926rIqGstqPHTUFa6sz4... 阅读全文

posted @ 2018-09-25 14:19 crac 阅读(3708) 评论(0) 推荐(0)

python 图片识别灰度
摘要:# -*- coding: cp936 -*- from skimage import io,transform,color import numpy as np def convert_gray(f,**args):#图片处理与格式化的函数 rgb=io.imread(f) #读取图片 gray=color.rgb2gray(rgb) #将彩色图片转换为灰度图片 ... 阅读全文

posted @ 2018-09-25 14:18 crac 阅读(2732) 评论(0) 推荐(1)

python 命令行颜色
摘要:#coding=utf-8 import ctypes,sys STD_INPUT_HANDLE = -10 STD_OUTPUT_HANDLE = -11 STD_ERROR_HANDLE = -12 def printRed(mess): set_cmd_text_color(FOREGROUND_RED) sys.stdout.write(mess) resetCo... 阅读全文

posted @ 2018-09-03 10:21 crac 阅读(953) 评论(0) 推荐(0)

sys.stdout.flush-倒计时
摘要:1. 2. 阅读全文

posted @ 2018-08-30 15:59 crac 阅读(223) 评论(0) 推荐(0)

低碳生活
该文被密码保护。

posted @ 2018-08-02 00:51 crac 阅读(1) 评论(0) 推荐(0)

万能英数脚本
摘要:#coding:utf8 import requests import Image import cStringIO import imghdr import urllib2 import ssl import urllib import sys import json import time reload(sys) sys.setdefaultencoding( "utf-8" ) ssl._... 阅读全文

posted @ 2018-07-19 23:07 crac 阅读(325) 评论(0) 推荐(0)

sample function
摘要:#coding:utf8 import requests import json import ssl import datetime import urllib import sys import json import time import random reload(sys) sys.setdefaultencoding( "utf-8" ) ssl._create_default_ht... 阅读全文

posted @ 2018-07-19 23:06 crac 阅读(290) 评论(0) 推荐(0)

get_time
摘要:def get_current_time(): #将python的datetime转换为unix时间戳 dtime = datetime.datetime.now() un_time = time.mktime(dtime.timetuple()) #print un_time #1509636609.0 #将unix时间戳转换为python 的dat... 阅读全文

posted @ 2018-06-26 20:36 crac 阅读(115) 评论(0) 推荐(0)

request设置cookies
摘要:mycookie = { "PHPSESSID":"56v9clgo1kdfo3q5q8ck0aaaaa" } request.get(url,cookies = mycookie) ) 阅读全文

posted @ 2018-06-12 14:56 crac 阅读(255) 评论(0) 推荐(0)

读取指定行
摘要:import linecache the_line = linecache.getline('d:/test.txt', 1) 阅读全文

posted @ 2018-06-12 14:56 crac 阅读(112) 评论(0) 推荐(0)

Nmap结果文件XML文件解析
摘要:对nmap扫描结果xml格式的文件进行解析,无需直接xml解析或读取,可直接使用模块: 1.nmapparser 安装:pip install nmapparser Demo: 解析: demo.py *.xml 结果输出: 2.python-libnmap 安装: pip install pyth 阅读全文

posted @ 2018-01-09 00:17 crac 阅读(6699) 评论(1) 推荐(0)

1.网站js文件获取
摘要:++++++++++++++++++++++ pls,input your domain like: http://111.com 阅读全文

posted @ 2018-01-06 21:49 crac 阅读(312) 评论(0) 推荐(0)

hmac md5
摘要:这种MD5似乎用得较少,今天碰到了 Mark下 阅读全文

posted @ 2017-07-27 18:14 crac 阅读(172) 评论(0) 推荐(0)

DES
摘要:import pyDes python -c "import pyDes; des = pyDes.des('This Key'); print des.encrypt('SomeData').encode('hex')" but KEY must 8 、16、24 import binascii 阅读全文

posted @ 2017-07-25 14:17 crac 阅读(182) 评论(0) 推荐(0)

python 验证码test
摘要:灰度化 from PIL import Imageimport numpy as np install numpy https://pypi.python.org/packages/2c/93/9556d25b1f23fd852fc2ddfcf68a4a62ba9e4ef83adabbf8921c8 阅读全文

posted @ 2017-05-24 22:09 crac 阅读(197) 评论(0) 推荐(0)

爬虫测试0425
该文被密码保护。

posted @ 2017-04-24 18:03 crac 阅读(4) 评论(0) 推荐(0)

Jetty-attack-test
摘要:import httplib, urllib, ssl, string, sys, getopt from urlparse import urlparse ''' Author: Gotham Digital Science Purpose: This tool is intended to provide a quick-and-dirty way for organizations to... 阅读全文

posted @ 2017-04-11 23:49 crac 阅读(167) 评论(0) 推荐(0)

1 2 3 下一页