摘要: import osdef file_name_modify(dir, dir_name): """修改文件名字""" # 获取文件夹目录列表 dir_list = os.listdir(dir) # 进入目录 os.chdir(dir) # 遍历列表 for file in dir_list: # 阅读全文
posted @ 2020-04-07 11:43 sure_feng 阅读(542) 评论(0) 推荐(0) 编辑
摘要: 1 import re 2 from pymysql import connect 3 import urllib.parse 4 import logging 5 6 7 URL_FUNC_DICT = dict() 8 9 def open_mysql(): 10 # 创建connect连接 11 conn = connect(h... 阅读全文
posted @ 2019-02-24 19:56 sure_feng 阅读(295) 评论(0) 推荐(0) 编辑
摘要: 1 # -*- coding:utf-8 -*- 2 # Author:Sure Feng 3 4 import os 5 import multiprocessing 6 import time 7 8 def copy_dir(src_dir, file, dest_dir, queue): 9 """文件夹复制""" 10 # 打开文件 11 src... 阅读全文
posted @ 2019-01-27 10:31 sure_feng 阅读(171) 评论(0) 推荐(0) 编辑
摘要: 1 # -*- coding:utf-8 -*- 2 # Author:Sure Feng 3 4 from selenium import webdriver 5 from lxml import etree 6 import time 7 import json 8 import openpyxl 9 10 class LaGou(object): ... 阅读全文
posted @ 2019-01-01 09:52 sure_feng 阅读(239) 评论(0) 推荐(0) 编辑
摘要: 1 # -*- coding: utf-8 -*- 2 import scrapy 3 from yg.items import YgItem 4 5 class YgSpiderSpider(scrapy.Spider): 6 name = 'yg_spider' 7 allowed_domains = ['wz.sun0769.com'] 8 sta... 阅读全文
posted @ 2018-12-09 17:50 sure_feng 阅读(365) 评论(0) 推荐(0) 编辑
摘要: 1 # -*- coding:utf-8 -*- 2 # Author:Sure Feng 3 4 import requests 5 from lxml import etree 6 import json 7 8 9 class QiubaiSpider(object): 10 def __init__(self): 11 self.tempt... 阅读全文
posted @ 2018-12-04 21:01 sure_feng 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 1 # -*- coding:utf-8 -*- 2 # Author:Sure Feng 3 4 import requests 5 import json 6 7 8 class DoubanFileSpider(object): 9 def __init__(self): 10 self.start_tempt_url = [ 11 ... 阅读全文
posted @ 2018-12-02 12:12 sure_feng 阅读(236) 评论(0) 推荐(0) 编辑
摘要: 1 # -*- coding:utf-8 -*- 2 # Author:Sure Feng 3 4 import requests 5 import json 6 import sys 7 8 class BaiduFanyi(object): 9 def __init__(self, trans_str): 10 self.trans_str = ... 阅读全文
posted @ 2018-11-28 22:10 sure_feng 阅读(342) 评论(0) 推荐(0) 编辑
摘要: 1 # -*- coding:utf-8 -*- 2 # Author:Sure Feng 3 4 import requests 5 6 class TiebaSpider(object): 7 def __init__(self, tieba_name): 8 self.tieba_name = tieba_name 9 self... 阅读全文
posted @ 2018-11-26 20:48 sure_feng 阅读(237) 评论(0) 推荐(0) 编辑
摘要: 1 # -*- coding:utf-8 -*- 2 # Author:Sure Feng 3 4 5 import threading 6 import time 7 8 9 num = 0 10 11 12 def sing(): 13 # 线程间共享全局变量,可能导致数据混乱 14 global num 15 for i in rang... 阅读全文
posted @ 2018-11-14 19:23 sure_feng 阅读(1683) 评论(0) 推荐(0) 编辑