JSFinder icon indicating copy to clipboard operation
JSFinder copied to clipboard

老是出现gbk错误 请问怎么解决呢?

Open zglaozhu opened this issue 6 years ago • 6 comments

使用命令py -3 JSFinder.py -u https://www.mi.com -d -ou mi_url.txt -os mi_subdomain.txt 老是出现 Traceback (most recent call last): File "JSFinder.py", line 247, in giveresult(urls, args.url) File "JSFinder.py", line 221, in giveresult print(url) UnicodeEncodeError: 'gbk' codec can't encode character '\u200b' in position 81: illegal multibyte sequence

zglaozhu avatar Jun 13 '19 03:06 zglaozhu

https://blog.csdn.net/jim7424994/article/details/22675759 参考一下这个。

Threezh1 avatar Jun 13 '19 04:06 Threezh1

谢谢你 但是研究了半天 在代码前面增加 import io

sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf8') # sys.stdout = io.TextIOWrapper( sys.stdout.buffer, encoding='gb18030') 改变标准输出的默认编码 还是没什么用

我太菜了

zglaozhu avatar Jun 13 '19 08:06 zglaozhu

应该是本地python的编码有问题,实在不行的话就把print(url)那一整段都删了吧,输出的时候使用-ou和-os命令。具体看README文件。

Threezh1 avatar Jun 13 '19 08:06 Threezh1

删除了还是 失败 我用https://blog.csdn.net/jim7424994/article/details/22675759中的列子

import urllib.request res=urllib.request.urlopen('http://www.baidu.com') htmlBytes=res.read() print(htmlBytes.decode('utf-8')) 报错

import io import sys import urllib.request sys.stdout = io.TextIOWrapper(sys.stdout.buffer,encoding='utf8') #改变标准输出的默认编码 res=urllib.request.urlopen('http://www.baidu.com') htmlBytes=res.read() print(htmlBytes.decode('utf-8'))

正常输出

但是修改到JSFinder.py 就没有用

zglaozhu avatar Jun 13 '19 09:06 zglaozhu

尝试用kali运行?实在不行的话,我也没办法。

Threezh1 avatar Jun 13 '19 09:06 Threezh1

Traceback (most recent call last): File "JSFinder.py", line 6, in import requests, argparse, sys, re ModuleNotFoundError: No module named 'requests' 这个错误是怎么回事 用的python3.6运行的

PLAPAP avatar Jun 16 '19 01:06 PLAPAP