🌱 I’m currently learning at hhu
⛳ My blog url: CVcat Home
📫 Chat with me: CVZC15751076989(wx) | 992822653(qq)
🎯 Looking for an internship
小红书爬虫,小红书笔记、主页、搜索爬取
🌱 I’m currently learning at hhu
⛳ My blog url: CVcat Home
📫 Chat with me: CVZC15751076989(wx) | 992822653(qq)
🎯 Looking for an internship
创建新任务就弹一下,然后过几秒消失,没法后台静默下载,怎么关掉呢
File "/home/xxxx/tmp/Spider_XHS/xhs_utils/xhs_util.py", line 74, in handle_profile_info
info = re.findall(r'<script>window.INITIAL_STATE=(.*?)</script>', html_text)[0]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range
/api/sns/web/v1/search/notes接口可以正常拿到笔记列表,但是/api/sns/web/v1/feed接口今天突然报错了,之前都是好的,报错的返回:
status: 461 status code 461, text: {"code":0,"success":true,"msg":"成功","data":{}}
一直返回461的响应,即便是换代理、换账号貌似还是不行,莫非小红书直接给该接口上了新的buf么。不知道各位道友是不是好的
Traceback (most recent call last):
File "d:\develop\pythonWorkspace\Spider_XHS\one-note.py", line 193, in
main()
File "d:\develop\pythonWorkspace\Spider_XHS\one-note.py", line 188, in main
handle_note(note_id_)
File "d:\develop\pythonWorkspace\Spider_XHS\one-note.py", line 115, in handle_note
ret = js.call('get_xs', '/api/sns/web/v1/feed', note_id, cookies['a1'])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\admin\AppData\Roaming\Python\Python311\site-packages\execjs_abstract_runtime_context.py", line 37, in call
return self._call(name, *args)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\admin\AppData\Roaming\Python\Python311\site-packages\execjs_external_runtime.py", line 92, in _call
return self.eval("{identifier}.apply(this, {args})".format(identifier=identifier, args=args))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\admin\AppData\Roaming\Python\Python311\site-packages\execjs_external_runtime.py", line 78, in eval
return self.exec(code)
^^^^^^^^^^^^^^^^
File "C:\Users\admin\AppData\Roaming\Python\Python311\site-packages\execjs_abstract_runtime_context.py", line 18, in exec
return self.exec(source)
^^^^^^^^^^^^^^^^^^^
File "C:\Users\admin\AppData\Roaming\Python\Python311\site-packages\execjs_external_runtime.py", line 88, in exec
return self._extract_result(output)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\admin\AppData\Roaming\Python\Python311\site-packages\execjs_external_runtime.py", line 167, in _extract_result
raise ProgramError(value)
execjs._exceptions.ProgramError: SyntaxError: 语法错误
能不能设置不下载图片和视频
全部都是下载失败
实际上已经安装了nodejs且安装了jsdom,是不是xhs又更新x-s算法?
是网站更新了吗,我的一直是笔记..不允许查看,看了下是https://edith.xiaohongshu.com/api/sns/web/v1/feed这个接口访问成功,但data一直为空,笔记是没删除网页可以查看的
我在网页版上手动保存的大小比用spider下载的图片大不少
画质不一样 不知道能让它和网页版上手动保存的画质一致么
楼主好
1、小红书一个关键词搜索最多获取两百多条笔记吗,
2、有没有什么办法能够解决这个搜索关键词获取笔记太少的问题啊,
3、如果设置多个账号或者iP代理会不会好点
Description: When running *.py files using the source code, I consistently encounter the "缺少nodejs环境" error. I have provided the necessary cookie.txt, and the exe file works fine (though the terminal window keeps appearing continuously).
Packages installed before running:
pip install xhs-spider -i https://pypi.org/simple
npm i jsdom
Current node version: nodejs v18.17
Operating System: Windows 11
如题
小红书原图是webp格式的,直接保存为jpg和png后在Windows上都显示不了,双击打开显示位图损坏,保存为webp就没问题
Traceback (most recent call last):
File "/Users/tinghuang/Spider_XHS/search.py", line 95, in
search.main(info)
File "/Users/tinghuang/Spider_XHS/search.py", line 79, in main
self.handle_note_info(query, number, sort, need_cover=True)
File "/Users/tinghuang/Spider_XHS/search.py", line 55, in handle_note_info
ret = js.call('get_xs', api, data, self.cookies['a1'])
TypeError: 'NoneType' object is not subscriptable
这块代码
elif type == 'video':
print(f"{name}开始下载, {media_url}")
start_time = time.time()
res = requests.get(media_url, stream=True)
size = 0
chunk_size = 1024 * 1024
content_size = int(res.headers["content-length"])
with open(path + '/' + name + '.mp4', mode="wb") as f:
for data in res.iter_content(chunk_size=chunk_size):
f.write(data)
size += len(data) # 已下载文件的大小
# 已完成的百分比
percentage = size / content_size
# 打印进度条
print(f'\r视频:%.2fMB\t' % (content_size / 1024 / 1024),
'下载进度:[%-50s%.2f%%]耗时:%.1fs' % ('>' * int(50 * percentage), percentage * 100, time.time() - start_time),
end='')
print(f"{name}下载完成")
在下载某些视频的时候,会报这个错误。网上搜了好像也没啥解决方法
urllib3.exceptions.ProtocolError: ('Connection broken: IncompleteRead(10485760 bytes read, 280808 more expected)', IncompleteRead(10485760 bytes read, 280808 more expected))
请问normal.py可以下载登录用户自身的收藏和点赞笔记吗?
如题,似乎最多只能200多条,有办法突破吗
请问作者大佬,这俄格反爬是针对用户还是针对ip啊,什么速度以内不会被封号啊
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.