Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(CNKI.js): 纠正POST表单数据,解决浏览器中抓取失败 #233

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

yfdyh000
Copy link
Contributor

#231.

之前的代码在Scaffold中正常,但浏览器中经常无反应。
之前代码实现与网站实际请求不同,F12-网络内是“请求负载”而非“表单数据”。

@2021521
Copy link

2021521 commented Nov 20, 2023

测试了5个文献,没有任何问题,感谢。

@l0o0 l0o0 merged commit 495c77a into l0o0:master Nov 20, 2023
@l0o0
Copy link
Owner

l0o0 commented Nov 20, 2023

感谢pr,非常及时。我有点不明白后面为什么要加responsetype

@yfdyh000
Copy link
Contributor Author

感谢pr,非常及时。我有点不明白后面为什么要加responsetype

https://github.com/zotero/translators/blob/master/index.d.ts 里有responseType,默认text,我当时理解为Content-Type头的封装。不过,没找到相关文档和代码。

@l0o0
Copy link
Owner

l0o0 commented Nov 20, 2023

感谢pr,非常及时。我有点不明白后面为什么要加responsetype

https://github.com/zotero/translators/blob/master/index.d.ts 里有responseType,默认text,我当时理解为Content-Type头的封装。不过,没找到相关文档和代码。

这 request headers 里设置了也不顶用啊,这两天真是让我找遍办法了。好像request headers 里设置了,在实际执行时,headers 并没有发送设置的参数。真是奇怪。

@l0o0
Copy link
Owner

l0o0 commented Nov 21, 2023

官方对 headers 的答复 https://groups.google.com/g/zotero-dev/c/ldRts9AoEf8

按那边的提示,去掉responseTepe 也能正常使用。看来还是我之前 headers 加太多了

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

Successfully merging this pull request may close these issues.

None yet

3 participants