示例#1
0
    def get_txt_page_encode(raw:str) -> str:
        try:
            encode = StringHelper.extra_equ_value(raw, 'charset', '"')
            encode = StringHelper.cutfrom(encode, '/')

            return encode
        except HttpConnectionFailedException as e:
            raise e
        except:
            return ''
示例#2
0
    def get_page_encode(self, url):
        try:
            raw = self.req.get(url)

            encode = StringHelper.extra_equ_value(raw, 'charset', '"')
            encode = StringHelper.cutfrom(encode,'/')

            return encode
        except HttpConnectionFailedException as e:
            raise e
        except:
            return ''