Skip to content
This repository has been archived by the owner on Oct 29, 2020. It is now read-only.

Commit

Permalink
🎨 🐛 重构代码+修复新闻搜索bug
Browse files Browse the repository at this point in the history
此次更新拆分了源码中的类和实现代码,并修复了百度新闻搜索改版导致的bug(#6
  • Loading branch information
samzhangjy committed Aug 23, 2020
1 parent 81affee commit 32b3a3f
Show file tree
Hide file tree
Showing 30 changed files with 50,876 additions and 546 deletions.
3 changes: 3 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[coverage:run]
omit =
venv/*
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,6 @@ zhihu.py
.DS_Store
download.py
/docs-old/
/docs/site/
/docs/site/
htmlcov/
.coverage
101 changes: 0 additions & 101 deletions .stignore

This file was deleted.

2 changes: 1 addition & 1 deletion baiduspider/api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
# 导入包
sys.path.append(os.path.abspath('./baiduspider/core'))

from baiduspider.core.main import BaiduSpider
from baiduspider.core import BaiduSpider

app = FastAPI()
spider = BaiduSpider()
Expand Down
2 changes: 1 addition & 1 deletion baiduspider/cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ BaiduSpider的命令行形式,用click制作。
python -m baiduspider.cli.cli
```

就可以在终端内查询了。要查看帮助,加上`-help`符就可以。目前仅支持网页搜索,文档正在编写中。
就可以在终端内查询了。要查看帮助,加上`--help`符就可以。目前仅支持网页搜索,文档正在编写中。
6 changes: 3 additions & 3 deletions baiduspider/cli/cli.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os
import sys
# 导入包
sys.path.append(os.path.abspath('./baiduspider/core'))
from baiduspider.core.main import BaiduSpider
sys.path.append(os.path.abspath('.'))
from baiduspider.core import BaiduSpider

import click
import readline
Expand All @@ -14,7 +14,7 @@
@click.option('--query', help='搜索关键词', prompt='请输入搜索关键词')
@click.option('--pn', help='搜索结果页码', prompt='请输入页码', default=1)
def search_web(query, pn):
r"""搜索百度网页"""
"""搜索百度网页"""
result_ = spider.search_web(query, pn=pn)
results = []
related = {}
Expand Down
Loading

0 comments on commit 32b3a3f

Please sign in to comment.