Skip to content

hankl/wechat2md

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wechat2md

微信公众号文章转 Markdown CLI 工具。

安装

pip install wechat2md

使用

# 基本用法
wechat2md https://mp.weixin.qq.com/s/xxxxx

# 指定输出目录
wechat2md https://mp.weixin.qq.com/s/xxxxx -o ./articles

# 指定文件名
wechat2md https://mp.weixin.qq.com/s/xxxxx -f my_article.md

# 使用隐秘模式(遇到反爬时)
wechat2md https://mp.weixin.qq.com/s/xxxxx --stealth

作为库使用

from wechat2md import fetch_article, html_to_markdown

# 抓取文章
article = fetch_article('https://mp.weixin.qq.com/s/xxxxx')
print(article['title'])

# 转换 HTML 为 Markdown
md = html_to_markdown(article['content'])

选项

选项 说明
-o, --output-dir 输出目录 (默认: ./data)
-f, --filename 输出文件名 (默认: 使用文章标题)
-s, --stealth 使用隐秘模式绕过反爬
-V, --version 显示版本号

License

MIT

About

微信公众号文章转 Markdown CLI 工具

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages