python
drzdryse
这个作者很懒,什么都没留下…
展开
-
python 爬取 mm131 图片
#!/usr/bin/env python#-*-conding:utf-8-*-import requests # 发送http请求from bs4 import BeautifulSoup # 解析htmlimport lxml # 解析器 中文不乱码import os #创建文件夹# 爬取 mm131 图片start_url = "http://www.mm131.com...原创 2019-01-25 15:24:43 · 153141 阅读 · 0 评论 -
# 找到字符串的位置分布 # 得到字符串里面的数字
# 找到字符串的位置分布def find_str_position(m_str, c_str): mlen = len(m_str) clen = len(c_str) position_list = [] for i in range(mlen): if i+clen <= mlen: tmp_str = ''...原创 2019-03-14 16:27:38 · 215 阅读 · 0 评论 -
Python中 isdigit() 和 isnumeric() 的区别
原文地址:https://www.cnblogs.com/philkang/p/8667035.htmlnum = "1" #unicodenum.isdigit() # Truenum.isdecimal() # Truenum.isnumeric() # Truenum = "1" # 全角num.isdigit() # Truenum.isdecimal() #...转载 2019-03-15 14:19:33 · 6261 阅读 · 2 评论 -
python 爬取动漫之家,下载漫画
#!/usr/bin/python3# -*- coding: utf-8 -*-import requests # 发送http请求from bs4 import BeautifulSoup # 解析htmlimport os # 创建目录import urllib # 解析URLfrom urllib import parse # 解析URLimport json # ...原创 2019-03-18 16:37:11 · 2284 阅读 · 2 评论 -
python 爬取网站 下载网站资源
#!/usr/bin/python3# -*- coding: utf-8 -*-import requests # 发送http请求from bs4 import BeautifulSoup # 解析htmlimport osfrom urllib import parseclass p_web(object): def __init__(self, web_u...原创 2019-03-18 16:38:49 · 1186 阅读 · 0 评论 -
python db类
import pymysqlclass DB: __host = 'localhost' # 服务器地址 __username = 'root' # 用户名 __password = '' # 密码 __database = 'test' # 数据库 __field = '*' # 查询字段 __where = '' # 条件 __sq...原创 2019-05-24 11:36:30 · 2782 阅读 · 0 评论