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

refactor: 获取原创微博长内容修改为接口调用 #406

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

junbaor
Copy link

@junbaor junbaor commented Jan 2, 2022

No description provided.

@junbaor
Copy link
Author

junbaor commented Jan 2, 2022

#397


logger = logging.getLogger('spider.comment_parser')


class CommentParser(Parser):
def __init__(self, cookie, weibo_id):
self.cookie = cookie
self.weibo_id = weibo_id
self.url = 'https://weibo.cn/comment/' + weibo_id
self.selector = handle_html(self.cookie, self.url)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

感谢贡献,selector这一行没有用到,建议删除。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

帮看下 22 行是不是用到了 self.weibo_id,我当时不加这个 ide 报错,没怎么写过 python 找猫化虎改的。

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

是16行selector相关的,它没有用到,可以去掉。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

明白了,已删除。

@junbaor
Copy link
Author

junbaor commented Jan 2, 2022

不太清楚这个变更对老用户会产生多大影响,请酌情合并,如果有人能在这个基础上完善就更好了。

@dataabc
Copy link
Owner

dataabc commented Jan 3, 2022

感谢贡献,刚发现现在的代码无法正确获取长转发,因为之前是解析的网页,现在原创微博改成了接口,转发没有修改。

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

2 participants