Need help with area-puppeteer?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

dwqs
152 Stars 88 Forks Do What The F*ck You Want To Public License 29 Commits 6 Opened issues

Description

基于 puppeteer 的中国行政区域抓取爬虫

Services available

!
?

Need anything else?

Contributors list

# 29,435
JavaScr...
CSS
vuejs2
vuejs
29 commits

build pass license

area-puppeteer

基于 puppeteer 的中国行政区域抓取爬虫

数据来源

数据更新

git clone [email protected]:dwqs/area-puppeteer.git
npm i
npm start // 生成市县区数据
npm run format // 格式化数据

生成的数据包含两份:

cities.js
areas.js
,前者是市级数据,后者是县区数据

格式化后会生成两份数据:

pca.js
pcaa.js
,前者仅省市数据,后者包含省市区数据
import Data from 'path/to/pcaa';

Data['86'] // 所有省份:{'110000': '北京市', '120000': '天津市', '130000': '河北省', ...}

Data['130000'] // 对应省份的所有城市:{'130100': '石家庄市', '130200': '唐山市', '130300': '秦皇岛市', ...}

Data['130200'] // 对应市的所有县区:{'130201': '市辖区', '130202': '路南区', '130203': '路北区', ...}

License

This repo is released under the WTFPL – Do What the Fuck You Want to Public License.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.