爬取全国「省市区县乡镇街道」数据来源于[京东]
go-city
演示
Go-city sync --dbname=WEBcron --driver=database --table=city
100% |█████████████████████████████████████████| (34/34, 2 it/min)
time="2023-03-04T10:29:26+08:00" level=info msg="数据同步完成,其中省级行政区:34,城市:452,区县:5234,乡镇街道:43564"
install
go install https://GitHub.com/xiaoxuan6/go-city.git
Usage
Sqilte
go-city sync --db=./sqlite.db
Database
go-city sync --driver=database --host=127.0.0.1 --port=3306 --username=root --passWord=root --dbname=city --table=city
More
NAME:
go-city sync
USAGE:
go-city sync [command options] [arguments...]
DESCRIPTION:
同步省市区到数据库
OPTIONS:
--driver value, -d value db driver,Support:sqlite、database、memory (default: "sqlite") [%GO_CITY_DRIVER%]
--db value database file (default: "./sqlite.db") [%GO_CITY_DB%]
--host value database host (default: "127.0.0.1") [%GO_CITY_DB_HOST%]
--port value database port (default: "3306") [%GO_CITY_DB_PORT%]
--username value database username (default: "root") [%GO_CITY_DB_USERNAME%]
--password value database password (default: "root") [%GO_CITY_DB_PASSWORD%]
--dbname value database dbname [%GO_CITY_DB_NAME%]
--table value database table name (default: "cities") [%GO_CITY_DB_TABLE_NAME%]
--help, -h show help
不要轻易放弃。学习成长的路上,我们长路漫漫,只因学无止境 Don't give up easily. On the way of learning and growing up, we have a long way to go, just because there is no end to learning.
相关文章