Skip to content
This repository has been archived by the owner on Sep 29, 2024. It is now read-only.

笔趣阁获取小说是乱码啊大佬 #50

Closed
Gpicachu opened this issue Aug 20, 2021 · 9 comments
Closed

笔趣阁获取小说是乱码啊大佬 #50

Gpicachu opened this issue Aug 20, 2021 · 9 comments

Comments

@Gpicachu
Copy link

笔趣阁获取小说是乱码啊大佬
“�ʱ������һ����������ֻ���Զ�үר�Ŀ���ǽ�ǵ����󣬷·�ûע�����Ķ�����
������״Ԫ��ͷһ����������������ֿ�ʼ��׾�ˡ���”

@aooiuu
Copy link
Owner

aooiuu commented Aug 21, 2021

我这边刚刚测试正常,能否提供截图?

@Gpicachu
Copy link
Author

大佬我用的是另一个网站 http://www.b5200.net/modules/article/search.php?searchkey= 这个网站的编码是gbk

@aooiuu aooiuu closed this as completed Aug 21, 2021
@Gpicachu
Copy link
Author

大佬 const rest = yield got(DOMAIN2 + pathStr+"/index_7.html");
const $ = cheerio.load(rest.body);
这个是不能在循环里运行吗
https://m.sobiquge.com 这个网站的章节每页只显示20个 我昨天去修改它 我把got 放在循环里就怎么也不显示了

@Gpicachu
Copy link
Author

yield got(DOMAIN2 + pathStr+"/index_7.html");
"/index_7.html" 正常这块谁活的循环 昨天没改出来我暂时写死了

@aooiuu
Copy link
Owner

aooiuu commented Aug 21, 2021

大佬 const rest = yield got(DOMAIN2 + pathStr+"/index_7.html");
const $ = cheerio.load(rest.body);
这个是不能在循环里运行吗
https://m.sobiquge.com 这个网站的章节每页只显示20个 我昨天去修改它 我把got 放在循环里就怎么也不显示了

每页只显示20个 PC版网页会显示全部章节,这样就不用循环了

@Gpicachu
Copy link
Author

我服了 got 没有gbk解码

@aooiuu
Copy link
Owner

aooiuu commented Aug 21, 2021

我服了 got 没有gbk解码

参考: https://blog.cmyr.ltd/archives/81e52f4c.html

got 的 api 和 request 的 api 都差不多,编码问题解决思路都是让请求返回 buffer, 再用 iconv-lite 解码

@Gpicachu
Copy link
Author

感谢大佬

@aooiuu
Copy link
Owner

aooiuu commented Aug 21, 2021

感谢大佬

不用谢也不是大佬

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants