fix: use consist paper url order

This commit is contained in:
NateScarlet 2019-09-20 19:05:12 +08:00
parent 2506828b14
commit 0213768511
No known key found for this signature in database
GPG Key ID: 5C242793B070309C
2 changed files with 2 additions and 1 deletions

View File

@ -39,6 +39,7 @@ def get_paper_urls(year: int) -> List[str]:
ret = re.findall(
r'<li class="res-list".*?<a href="(.+?)".*?</li>', body, flags=re.S)
ret = [i for i in ret if i not in PAPER_EXCLUDE]
ret.sort()
return ret

View File

@ -9,8 +9,8 @@ from .filetools import _file_path
def test_get_paper_urls():
assert get_paper_urls(2019) == [
'http://www.gov.cn/zhengce/content/2018-12/06/content_5346276.htm',
'http://www.gov.cn/zhengce/content/2019-03/22/content_5375877.htm',
'http://www.gov.cn/zhengce/content/2018-12/06/content_5346276.htm'
]