示例#1
0
 def get_random_html_file_name(self):
     u"""
     生成一个随机html
     :return:
     :rtype:
     """
     filename = ExtraTools.md5(str(uuid.uuid4())) + '.xhtml'
     return filename
示例#2
0
 def create_filename(self, href):
     u"""
     根据 href 创建md5编码之后的文件名
     :param href:
     :return:
     """
     filename = ExtraTools.md5(href) + '.jpg'
     return filename
示例#3
0
 def create_filename(self, href):
     u"""
     根据 href 创建md5编码之后的文件名
     :param href:
     :return:
     """
     filename = ExtraTools.md5(href) + '.jpg'
     return filename
示例#4
0
 def get_random_html_file_name(self):
     u"""
     生成一个随机html
     :return:
     :rtype:
     """
     filename = ExtraTools.md5(str(uuid.uuid4())) + '.xhtml'
     return filename
示例#5
0
 def get_cookie(self):
     filename = ExtraTools.md5(ExtraTools.get_time())
     with open(filename, 'w') as f:
         pass
     self.cookieJar.save(filename)
     with open(filename) as f:
         content = f.read()
     os.remove(filename)
     return content
示例#6
0
 def get_cookie(self):
     filename = ExtraTools.md5(ExtraTools.get_time())
     with open(filename, 'w') as f:
         pass
     self.cookieJar.save(filename)
     with open(filename) as f:
         content = f.read()
     os.remove(filename)
     return content
示例#7
0
 def create_filename(self, href):
     filename = ExtraTools.md5(href) + '.jpg'
     return filename
示例#8
0
 def create_filename(self, href):
     filename = ExtraTools.md5(href) + '.jpg'
     return filename
示例#9
0
    def parse_article_id(self):

        from src.tools.extra_tools import ExtraTools
        article_id = ExtraTools.md5(self.info['title'])
        self.info['article_id'] = article_id