code
stringlengths
1
1.72M
language
stringclasses
1 value
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-2 @author: zhongfeng ''' from suning.suningparser import parserDict,sunningRoot from spider import main if __name__ == '__main__': main(sunningRoot,parserDict)
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-2 @author: zhongfeng ''' from efeihu.efeihupageparser import parserDict,efeihuRoot from spider import main if __name__ == '__main__': main(efeihuRoot,parserDict)
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-11-22 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from pageparser import * import urlparse from spiderconfigparser import SpiderConfig efeihuRoot = ObuyUrlSummary(url=r'http://www.efeihu.com/', name='efeihu') class EfeihuAllSortPa...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-2 @author: zhongfeng ''' from efeihu.efeihupageparser import parserDict,efeihuRoot from spider import main if __name__ == '__main__': main(efeihuRoot,parserDict)
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-11-22 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from pageparser import * import urlparse from spiderconfigparser import SpiderConfig efeihuRoot = ObuyUrlSummary(url=r'http://www.efeihu.com/', name='efeihu') class EfeihuAllSortPa...
Python
#/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-7-28 @author: zhongfeng ''' from crawlerhttp import crawle from logfacade import LoggerFactory from threadpool import ThreadPool, WorkRequest from urlparse import urlparse import os, sys import time import threading from threading impor...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-9-24 @author: zhongfeng ''' import re,os,sys import chardet from pageparser import ObuyUrlSummary from utils import Singleton from ConfigParser import ConfigParser, NoOptionError def __getUrlSumsFromSection(section): curPath = os....
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-11-29 @author: zhongfeng ''' import os, time import zipfile from ftplib import FTP,error_perm import sys,glob from proxysock import setup_http_proxy from spiderconfigparser import SpiderConfig ip = '58.64.204.70' port = '21' usernam...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-7-26 图片识别模块 @author: zhongfeng ''' import ImageFilter, ImageChops import Image import re,itertools import time try: import psyco psyco.full() except ImportError: pass class CaptchaAlgorithm(object): '''captcha algorithm''' def Le...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-7-27 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from BeautifulSoup import BeautifulSoup from crawlerhttp import UrlSummary, CrawlerType, crawleRetries from time import strftime import chardet, re from urlparse import urlparse from t...
Python
#!/usr/bin/python import socket # Class that wraps a real socket and changes it to a HTTP tunnel whenever a connection is asked via the "connect" method class ProxySock : def __init__(self, socket, proxy_host, proxy_port) : # First, use the socket, without any change self.socket = socket ...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-16 @author: zhongfeng ''' GOME_FEATURES_MAP = { ''' __ __ __ __ __ __ __ __ ## ## ''' : '.', ''' ____...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-7-26 国美价格图片识别模块 @author: zhongfeng ''' import ImageFilter, ImageChops from captcha_price import * from gome.gome_feature import GOME_FEATURES_MAP import Image import itertools import re import time try: import psyco psyco.full() except Import...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-8-20 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from pageparser import * from threadpool import ThreadPool, WorkRequest from cStringIO import StringIO from gome.image_price import captcha_gome from spiderconfigparser import SpiderCon...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-2 @author: zhongfeng ''' from gome.gomepageparser import parserDict,gomeRoot from spider import main if __name__ == '__main__': main(gomeRoot,parserDict)
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-7-26 国美价格图片识别模块 @author: zhongfeng ''' import ImageFilter, ImageChops from captcha_price import * from gome.gome_feature import GOME_FEATURES_MAP import Image import itertools import re import time try: import psyco psyco.full() except Import...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-8-20 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from pageparser import * from threadpool import ThreadPool, WorkRequest from cStringIO import StringIO from gome.image_price import captcha_gome from spiderconfigparser import SpiderCon...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-2 @author: zhongfeng ''' from gome.gomepageparser import parserDict,gomeRoot from spider import main if __name__ == '__main__': main(gomeRoot,parserDict)
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-16 @author: zhongfeng ''' GOME_FEATURES_MAP = { ''' __ __ __ __ __ __ __ __ ## ## ''' : '.', ''' ____...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-11-25 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from pageparser import * from spiderconfigparser import SpiderConfig lusenRoot = ObuyUrlSummary(url=r'http://www.lusen.com/', name='lusen') class LusenAllSortParser(RootCatagoryPage...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-11-25 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from pageparser import * from spiderconfigparser import SpiderConfig lusenRoot = ObuyUrlSummary(url=r'http://www.lusen.com/', name='lusen') class LusenAllSortParser(RootCatagoryPage...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-2 @author: zhongfeng ''' from lusen.lusenpageparser import parserDict,lusenRoot from spider import main if __name__ == '__main__': main(lusenRoot,parserDict)
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-2 @author: zhongfeng ''' from lusen.lusenpageparser import parserDict,lusenRoot from spider import main if __name__ == '__main__': main(lusenRoot,parserDict)
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- import MySQLdb import os import hashlib #DB parameter def update360buyRepu(): conn = getConnect() qPage = MySQLQueryPagination(conn=conn, numPerPage=2000) sqlStr = r'SELECT id,repu FROM `prod_base_info_3c` where site_id=6' for result in ...
Python
#!/usr/bin/env python # -*- coding:utf-8 -*- ''' Created on 2011-9-19 @author: zhongfeng ''' import os,re,sys import hashlib import operator import shutil from ConfigParser import ConfigParser from decimal import Decimal import MySQLdb from pageparser import ParserUtils #DB parameter strHost = 'l...
Python
#!/usr/bin/env python # -*- coding:utf-8 -*- ''' Created on 2011-9-19 @author: zhongfeng ''' import re,os,sys,itertools,glob from dbproc.basedbproc import * from decimal import Decimal def wrapDecimal(priceStr): return Decimal(str(priceStr)) def calRealPrice(curPrice, coupon, orderCut, crashCut...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- import MySQLdb import os import hashlib #DB parameter def update360buyRepu(): conn = getConnect() qPage = MySQLQueryPagination(conn=conn, numPerPage=2000) sqlStr = r'SELECT id,repu FROM `prod_base_info_3c` where site_id=6' for result in ...
Python
#!/usr/bin/env python # -*- coding:utf-8 -*- ''' Created on 2011-9-19 @author: zhongfeng ''' import re,os,sys,itertools,glob from dbproc.basedbproc import * from decimal import Decimal def wrapDecimal(priceStr): return Decimal(str(priceStr)) def calRealPrice(curPrice, coupon, orderCut, crashCut...
Python
#!/usr/bin/env python # -*- coding:utf-8 -*- ''' Created on 2011-9-19 @author: zhongfeng ''' import os,re,sys import hashlib import operator import shutil from ConfigParser import ConfigParser from decimal import Decimal import MySQLdb from pageparser import ParserUtils #DB parameter strHost = 'l...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-7-27 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from BeautifulSoup import BeautifulSoup, Comment from pageparser import * import itertools import json import os import re import urllib import urlparse import string from enum impor...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-2 @author: zhongfeng ''' from pageparser import ObuyUrlSummary from amazon.amazonpageparser import parserDict,rootUrlSummary from spider import ObuySpider,main import os,sys from logfacade import LoggerFactory class AmazonSpider(ObuySpi...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-2 @author: zhongfeng ''' from pageparser import ObuyUrlSummary from amazon.amazonpageparser import parserDict,rootUrlSummary from spider import ObuySpider,main import os,sys from logfacade import LoggerFactory class AmazonSpider(ObuySpi...
Python
#/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-7-27 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from pageparser import * import re from copy import deepcopy class AmazonAllSortParser(RootCatagoryPageParser): ''' 从http://www.amazon.cn/gp/site-directory获取所有的分类信息, ...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-7-27 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from BeautifulSoup import BeautifulSoup, Comment from pageparser import * import itertools import json import os import re import urllib import urlparse import string from enum impor...
Python
#/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-10-10 @author: zhongfeng ''' ## {{{ http://code.activestate.com/recipes/84317/ (r2) from threading import Condition,Thread import copy class Future(object): def __init__(self,func,*param): # Constructor self.__d...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-8-02 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from pageparser import * from spiderconfigparser import SpiderConfig dangdangRoot = ObuyUrlSummary(url=r'http://category.dangdang.com/', name='dangdang') class DangDangAllSortParse...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-2 @author: zhongfeng ''' from dangdang.dangpageparser import parserDict,dangdangRoot from spider import main if __name__ == '__main__': main(dangdangRoot,parserDict)
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-2 @author: zhongfeng ''' from dangdang.dangpageparser import parserDict,dangdangRoot from spider import main if __name__ == '__main__': main(dangdangRoot,parserDict)
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-8-02 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from pageparser import * from spiderconfigparser import SpiderConfig dangdangRoot = ObuyUrlSummary(url=r'http://category.dangdang.com/', name='dangdang') class DangDangAllSortParse...
Python
#/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-07-11 日志工厂类 @author: zhongfeng ''' import logging.config import os,sys class LoggerFactory(object): _loggerFac = None def __init__(self): pass def __new__(cls): ''' 单态实现,初始化一次 ...
Python
import os, marshal, thread # Filename used for index files, must not contain numbers INDEX_FILENAME = 'index' # Exception thrown when calling get() on an empty queue class Empty(Exception): pass class PersistentQueue: def __init__(self, name, cache_size=512, marshal=marshal): """ Create a persi...
Python
#!/usr/bin/python import socket # Class that wraps a real socket and changes it to a HTTP tunnel whenever a connection is asked via the "connect" method class ProxySock : def __init__(self, socket, proxy_host, proxy_port) : # First, use the socket, without any change self.socket = socket ...
Python
#/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-11-9 @author: zhongfeng ''' from egou.egoupageparser import * from crawlerhttp import crawle from pageparser import * from dbproc.catagoryproc import * def getContentFromUrlSum(urlsum): while True: result = crawle(urlsum)...
Python
#/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-11-09 @author: zhongfeng ''' import re from pageparser import * egouRoot = ObuyUrlSummary(url=r'http://www.egou.com/', name='egou') mainHost = 'http://www.egou.com' def filterCatName(name): p = re.compile(r'\([0-9]*\)') retur...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-2 @author: zhongfeng ''' from newegg.neweggpageparser import parserDict,newEggRoot from spider import main if __name__ == '__main__': main(newEggRoot,parserDict)
Python
#/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-7-27 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from pageparser import * import re from spiderconfigparser import SpiderConfig from crawlerhttp import crawleRetries from utils import Future newEggRoot = ObuyUrlSummary(url=ur'http:/...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-2 @author: zhongfeng ''' from newegg.neweggpageparser import parserDict,newEggRoot from spider import main if __name__ == '__main__': main(newEggRoot,parserDict)
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-7-27 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from BeautifulSoup import BeautifulSoup from crawlerhttp import UrlSummary, CrawlerType, crawleRetries from time import strftime import chardet, re from urlparse import urlparse from t...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-11-29 @author: zhongfeng ''' import os, time import zipfile from ftplib import FTP,error_perm import sys,glob from proxysock import setup_http_proxy from spiderconfigparser import SpiderConfig ip = '58.64.204.70' port = '21' usernam...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-16 @author: zhongfeng ''' COO8_FEATURES_MAP = { ''' __ __ __ __ __ __ __ __ __ __ ## #_ ''' : '.', ...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-16 @author: zhongfeng ''' COO8_FEATURES_MAP = { ''' __ __ __ __ __ __ __ __ __ ## #_ ## ''' : '.', ...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-7-26 京东价格图片识别模块 @author: zhongfeng ''' import ImageFilter, ImageChops from captcha_price import * from coo8.coo8_feature2 import COO8_FEATURES_MAP import Image import itertools import re import time try: import psyco psyco.full() except Impor...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-7-26 京东价格图片识别模块 @author: zhongfeng ''' import ImageFilter, ImageChops from captcha_price import * from coo8.coo8_feature2 import COO8_FEATURES_MAP import Image import itertools import re import time try: import psyco psyco.full() except Impor...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-1 @author: zhongfeng ''' from coo8.coo8pageparser import parserDict,coo8Root from spider import main if __name__ == '__main__': main(coo8Root,parserDict)
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-16 @author: zhongfeng ''' COO8_FEATURES_MAP = { ''' __ __ __ __ __ __ __ __ __ ## #_ ## ''' : '.', ...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-16 @author: zhongfeng ''' COO8_FEATURES_MAP = { ''' __ __ __ __ __ __ __ __ __ __ ## #_ ''' : '.', ...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-8-7 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from cStringIO import StringIO from coo8.image_price import captcha_coo8 from crawlerhttp import crawleRetries from pageparser import * from threadpool import ThreadPool, WorkRequest im...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-8-7 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from cStringIO import StringIO from coo8.image_price import captcha_coo8 from crawlerhttp import crawleRetries from pageparser import * from threadpool import ThreadPool, WorkRequest im...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-1 @author: zhongfeng ''' from coo8.coo8pageparser import parserDict,coo8Root from spider import main if __name__ == '__main__': main(coo8Root,parserDict)
Python
#/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-9-19 @author: zhongfeng ''' import sys,os from dbproc.basedbproc import * def createSiteCat(urls, siteName, catKeyFunc=getCatKey,saveFlag = True): siteId = getSiteIdByName(siteName) for urlsum in urls: parent = urlsum.pare...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- import os,sys import glob from dbproc.basedbproc import getConnect,initClientEncode #=============================================================================== # 表 `prod_catagory` db proc #=====================================================================...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- import os,sys import glob from dbproc.basedbproc import getConnect,initClientEncode #=============================================================================== # 表 `prod_catagory` db proc #=====================================================================...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-11-11 @author: zhongfeng ''' from itertools import chain import os from dbproc.basedbproc import getCatBySiteIdAndLevel,getAllWebsiteBaseInfo,seEncode def createSiteCat(site_id): catDict = {} for level in xrange(0,3): c...
Python
#!/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-11-11 @author: zhongfeng ''' from itertools import chain import os from dbproc.basedbproc import getCatBySiteIdAndLevel,getAllWebsiteBaseInfo,seEncode def createSiteCat(site_id): catDict = {} for level in xrange(0,3): c...
Python
#! /usr/bin/env python # -*- coding: utf-8 -*- import ez_setup import shutil, sys, os, glob ez_setup.use_setuptools() from setuptools import setup, find_packages import py2exe curpath = os.path.dirname(os.path.abspath(__file__)) def find_py_modules(): fileList = (os.path.split(full)[-1] for full...
Python
#!python """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() If you want to require a specific version of setuptools...
Python
#! /usr/bin/env python # -*- coding: utf-8 -*- import ez_setup import shutil, sys, os, glob ez_setup.use_setuptools() from setuptools import setup, find_packages import py2exe curpath = os.path.dirname(os.path.abspath(__file__)) def find_py_modules(): fileList = (os.path.split(full)[-1] for full...
Python
#!python """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() If you want to require a specific version of setuptools...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-7-26 京东价格图片识别模块 @author: zhongfeng ''' import ImageFilter, ImageChops from captcha_price import * from j360buy.j360_feature import __360buy_FEATURES_MAP__ import Image import re import time try: import psyco psyco.full() except ImportError: ...
Python
#/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-7-27 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from cStringIO import StringIO from j360buy.image_price import captcha_360buy from crawlerhttp import crawle from pageparser import * from threadpool import ThreadPool, WorkRequest impo...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-16 @author: zhongfeng ''' __360buy_FEATURES_MAP__ = { ''' __ __ __ __ __ ...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-7-26 京东价格图片识别模块 @author: zhongfeng ''' import ImageFilter, ImageChops from captcha_price import * from j360buy.j360_feature import __360buy_FEATURES_MAP__ import Image import re import time try: import psyco psyco.full() except ImportError: ...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-1 @author: zhongfeng ''' from j360pageparser import J360buyAllSortParser,J360buySort3PageParser,J360buySort4PageParser from pageparser import ObuyUrlSummary from spider import ObuySpider if __name__ == '__main__': parserDict = {0...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-16 @author: zhongfeng ''' __360buy_FEATURES_MAP__ = { ''' __ __ __ __ __ ...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-1 @author: zhongfeng ''' from j360pageparser import J360buyAllSortParser,J360buySort3PageParser,J360buySort4PageParser from pageparser import ObuyUrlSummary from spider import ObuySpider if __name__ == '__main__': parserDict = {0...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-7-26 京东价格图片识别模块 @author: zhongfeng ''' import ImageFilter, ImageChops import Image import re import time try: import psyco psyco.full() except ImportError: pass class CaptchaAlgorithm(object): '''captcha algorithm''' def Levensht...
Python
#/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2006-02-11 抓取核心类,用于抓取页面; 可以支持登陆抓取等; @author: zhongfeng ''' from __future__ import with_statement import urllib import urllib2 import socket import gzip import zlib import cookielib from copy import deepcopy from threadpool import Threa...
Python
#/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-8-02 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from pageparser import * class IcsonAllSortParser(RootCatagoryPageParser): ''' 从http://sz.icson.com/portal.html获取所有的分类信息, 组合成ObuyUrlSummary ''' ...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-2 @author: zhongfeng ''' from icson.icsonpageparser import IcsonAllSortParser,IcsonSort3PageParser,IcsonSort4PageParser from pageparser import ObuyUrlSummary from spider import ObuySpider if __name__ == '__main__': parserDict = {...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-2 @author: zhongfeng ''' from icson.icsonpageparser import IcsonAllSortParser,IcsonSort3PageParser,IcsonSort4PageParser from pageparser import ObuyUrlSummary from spider import ObuySpider if __name__ == '__main__': parserDict = {...
Python
#! /usr/bin/env python # -*- coding: utf-8 -*- # setup.py # Part of 21obuys, a package providing enumerated types for Python. # # Copyright © 2007 Ben Finney # This is free software; you may copy, modify and/or distribute this work # under the terms of the GNU General Public License, version 2 or later # or, at your ...
Python
#/usr/bin/env python # -*- coding: utf-8 -*- import re import time import random from BeautifulSoup import BeautifulSoup from crawlerhttp import UrlSummary, crawle urlsProxy = ["http://proxy.ipcn.org/proxylist.html"] #urlsProxy = ["http://www.proxycn.com/html_proxy/http-1.html"] desSite = 'http://www.360...
Python
#/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-7-27 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from pageparser import * class SuningAllSortParser(RootCatagoryPageParser): ''' 从http://www.suning.com/获取所有的分类信息, 组合成ObuyUrlSummary ''' mainHos...
Python
#/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-7-28 @author: zhongfeng ''' from crawlerhttp import crawle from logfacade import LoggerFactory from threadpool import ThreadPool, WorkRequest from urlparse import urlparse import os import time import threading from threading import sta...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-7-26 京东价格图片识别模块 @author: zhongfeng ''' import ImageFilter, ImageChops import Image import re import time try: import psyco psyco.full() except ImportError: pass class CaptchaAlgorithm(object): '''captcha algorithm''' def Levensht...
Python
#!python """Bootstrap setuptools installation If you want to use setuptools in your package's setup.py, just include this file in the same directory with it, and add this to the top of your setup.py:: from ez_setup import use_setuptools use_setuptools() If you want to require a specific version of setuptools...
Python
#/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-7-27 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from pageparser import * class GomeAllSortParser(RootCatagoryPageParser): ''' 从http://www.gome.com.cn/allSort.html获取所有的分类信息, 组合成ObuyUrlSummary ''' ...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-2 @author: zhongfeng ''' from gomepageparser import GomeAllSortParser,GomeSort3PageParser,GomeSort4PageParser from pageparser import ObuyUrlSummary from spider import ObuySpider if __name__ == '__main__': parserDict = {0:GomeAllS...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-2 @author: zhongfeng ''' from gomepageparser import GomeAllSortParser,GomeSort3PageParser,GomeSort4PageParser from pageparser import ObuyUrlSummary from spider import ObuySpider if __name__ == '__main__': parserDict = {0:GomeAllS...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-2 @author: zhongfeng ''' from pageparser import ObuyUrlSummary from spider import ObuySpider from amazon.amazonpageparser import AmazonSort3JsonParser, AmazonSort1Parser,\ AmazonSort2PageParser from amazon.amazonpageparser import Ama...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-2 @author: zhongfeng ''' from pageparser import ObuyUrlSummary from spider import ObuySpider from amazon.amazonpageparser import AmazonSort3JsonParser, AmazonSort1Parser,\ AmazonSort2PageParser from amazon.amazonpageparser import Ama...
Python
#/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-7-27 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from pageparser import * import re from copy import deepcopy class AmazonAllSortParser(RootCatagoryPageParser): ''' 从http://www.amazon.cn/gp/site-directory获取所有的分类信息, ...
Python
#/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-7-27 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from BeautifulSoup import BeautifulSoup, Comment from copy import deepcopy from pageparser import * import itertools import json import os import re import urllib import urlparse ...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-2 @author: zhongfeng ''' from dangpageparser import DangDangAllSortParser,DangDangSort3PageParser,DangDangSort4PageParser from pageparser import ObuyUrlSummary from spider import ObuySpider if __name__ == '__main__': parserDict =...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-2 @author: zhongfeng ''' from dangpageparser import DangDangAllSortParser,DangDangSort3PageParser,DangDangSort4PageParser from pageparser import ObuyUrlSummary from spider import ObuySpider if __name__ == '__main__': parserDict =...
Python
#/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-8-02 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from pageparser import * class DangDangAllSortParser(RootCatagoryPageParser): ''' 从http://category.dangdang.com/?ref=www-0-C 获取所有的分类信息, 组合成ObuyUrlSummary,...
Python
#/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-07-11 日志工厂类 @author: zhongfeng ''' import logging.config import os class LoggerFactory(object): _loggerFac = None def __init__(self): pass def __new__(cls): ''' 单态实现,初始化一次 '...
Python
import os, marshal, thread # Filename used for index files, must not contain numbers INDEX_FILENAME = 'index' # Exception thrown when calling get() on an empty queue class Empty(Exception): pass class PersistentQueue: def __init__(self, name, cache_size=512, marshal=marshal): """ Create a persi...
Python
#!/usr/bin/env python # -*- coding: utf8 -*- ''' Created on 2011-8-2 @author: zhongfeng ''' from neweggpageparser import NewEggAllSortParser,NewEggSort3PageParser,NewEggSort4PageParser from pageparser import ObuyUrlSummary from spider import ObuySpider if __name__ == '__main__': parserDict = {0:...
Python
#/usr/bin/env python # -*- coding: utf-8 -*- ''' Created on 2011-7-27 主要用于从网站上爬取信息后,抽取页面信息; @author: zhongfeng ''' from pageparser import * import re class NewEggAllSortParser(RootCatagoryPageParser): ''' 从http://www.newegg.com.cn/CategoryList.htm获取所有的分类信息, 组合成ObuyUrlSu...
Python