Skip to content

Instantly share code, notes, and snippets.

@pityonline
Created April 4, 2020 10:23
Show Gist options
  • Save pityonline/6465639c68a865c0c4b3954c62474649 to your computer and use it in GitHub Desktop.
Save pityonline/6465639c68a865c0c4b3954c62474649 to your computer and use it in GitHub Desktop.
深圳小汽车号段
#!/usr/bin/env bash
# the cookie string can be generated by accessing https://gd.122.gov.cn/views/vehxhhdpub.html
# then copy the request as cURL from Chrome
url='https://gd.122.gov.cn/m/mvehxh/getTfhdList'
cookie=''
payload='glbm=440300000400&hpzl=02&type=0&startTime=2020-02-04&endTime=2020-04-04'
save_to='sz_xqc_nums.txt'
for i in $(seq 12);
do
curl -s $url --header "$cookie" --data "page=$i&$payload" \
| jq '.data.list.content[].subhd'
done > $save_to
# change to gsed if OS is Linux
gsed -i 's/"//g' $save_to
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment