Add files via upload

Version 2.0:Add shell&python code
This commit is contained in:
yiliyas
2022-05-15 08:29:34 +08:00
committed by GitHub
parent df67ba5b36
commit eab469e834
5 changed files with 244 additions and 0 deletions

40
code/tjgb.md Normal file
View File

@@ -0,0 +1,40 @@
- [**返回**](../README.md) | [**下载**](../data/data.md)
> **shell命令一句话爬虫**
### 下载统计公报 :+1::+1::+1:
#### 2013~2021年
```
wget http://www.stats.gov.cn/tjsj/tjgb/ndtjgb/index.html|
xargs cat index.html |
grep -E "t202|t201[4-9]"|
grep "cont_tit"|
awk -F '"' '{print "http://www.stats.gov.cn/"$2}'|
xargs wget
```
#### 2001~2012年
```
wget http://www.stats.gov.cn/tjsj/tjgb/ndtjgb/index.html|
xargs cat index.html |
grep -E "t201[0-3]|t200[0-9]"|
grep "cont_tit"|
awk -F '"' '{print "http://www.stats.gov.cn/tjsj/tjgb/ndtjgb"$2}'|
xargs wget
```
#### 1982~2000年
```
wget http://www.stats.gov.cn/tjsj/tjgb/ndtjgb./index_1.html|
xargs cat index_1.html |
grep "t2002"|
grep "cont_tit"|
awk -F '"' '{print "http://www.stats.gov.cn/tjsj/tjgb/ndtjgb"$2}'|
xargs wget
```
#### 1978~1981年
```
wget http://www.stats.gov.cn/tjsj/tjgb/ndtjgb./index_2.html|
xargs cat index_2.html|
grep "t2002"|
grep "cont_tit"|
awk -F '"' '{print "http://www.stats.gov.cn/tjsj/tjgb/ndtjgb"$2}'|
xargs wget
```