Threezh1 / JSFinder

JSFinder is a tool for quickly extracting URLs and subdomains from JS files on a website.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

zglaozhu opened this issue · 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

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

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

我太菜了

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

删除了还是 失败 我用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 就没有用

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

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