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

配置好json后,用pycharm运行Python3 -m weibo_spider没有报错也没有任何输出 #635

Open
biejingaoguai opened this issue Feb 4, 2025 · 11 comments
Labels
failed 程序运行出错

Comments

@biejingaoguai
Copy link

为了更好的解决问题,请认真回答下面的问题。等到问题解决,请及时关闭本issue。

  • 问:请您指明哪个版本运行出错(github版/PyPi版/全部)?

答:github

  • 问:您使用的是否是最新的程序(是/否)?

答:是

  • 问:爬取任意用户都会运行出错吗(是/否)?

答:是

  • 问:若只有爬特定微博时才出错,能否提供出错微博的weibo_id或url(非必填)?

答:

  • 问:若您已提供出错微博的weibo_id或url,可忽略此内容,否则能否提供出错账号的user_id及您配置的since_date,方便我们定位出错微博(非必填)?

答:7072370695 2000-01-01

  • 问:如果方便,请您描述出错详情,最好附上错误提示。

答:

Image

@biejingaoguai biejingaoguai added the failed 程序运行出错 label Feb 4, 2025
@dataabc
Copy link
Owner

dataabc commented Feb 4, 2025

感谢反馈,您可以使用单独的命令行工具运行。

@biejingaoguai
Copy link
Author

请问我应该怎么做,我进入了管理员权限的命令行中,但是在cd C:\Users\AOOOOOOO\Desktop\weiboSpider-master\weiboSpider-master\weibo_spider后,我在这里使用python3 -m weibo_spider没有效果,我觉得可能是我有什么搞错了

@biejingaoguai
Copy link
Author

就是没有报错也没有运行

@dataabc
Copy link
Owner

dataabc commented Feb 5, 2025

您可以单独运行__main__.py这个文件,和上面的效果是一样的。或者您如果方便,可以使用第三方的cmd工具,系统自带的有时会报错。如果都不行,您也可以使用免cookie版。

@biejingaoguai
Copy link
Author

啊好的解决了,但是目前配置好cookies后同样遇到了无法解析cookies的问题,只能是切换到旧版chrome吗

@biejingaoguai
Copy link
Author

或者说我应该用哪一版的chrome可以正常使用

@dataabc
Copy link
Owner

dataabc commented Feb 5, 2025

新版的chrome好像自动获取cookie有问题,您也可以不依赖chrome,手动获取cookie,也可以运行。第一次运行时因为程序文件夹内没有config.json,会调用chrome获取cookie(这可能出现上面的错误),这时您手动获取cookie写入config.json就可以了。

@biejingaoguai
Copy link
Author

这个问题出现在“我已经手动获取cookie了之后并添加在config,json,然后再cmd用管理员方式运行,用python -m weibo_spider仍然会自动抓取chrome中的cookie”之后,您可以看我上面的截图,那张截图中已经包含了config.json,也可以看到我的cookie,也重新打开pycharm以及保存了json文件,主要是我已经有config,json为啥还会调用呢。。。我真的搞不懂了啊啊啊

@biejingaoguai
Copy link
Author

我感觉我的操作没有任何问题啊,就是一步一步按照操作来的

@dataabc
Copy link
Owner

dataabc commented Feb 5, 2025

可能是程序的bug,您注释掉这一行 看看。

@biejingaoguai
Copy link
Author

太感谢了注释掉后解决了非常感谢您

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
failed 程序运行出错
Projects
None yet
Development

No branches or pull requests

2 participants