2021年7月23日 星期五

三個Python指令用來初探農情報告資訊網來看百香果的故鄉在南投

Python有強大的爬蟲能力,其中Requests套件最為基本也是最常用的套件之一。在我們做更何計畫之前都需要調查數據,以百香果為例,要怎樣才能得知。

農情報告資訊網有許多很不錯的資訊,當我們在瀏覽器下,輸入網址:https://agr.afa.gov.tw/afa/afa_frame.jsp,就可以查詢相關農情報告。

接下來,使用Requests套件,來爬出其原始內容。
程式碼:

1
2
3
import requests
r = requests.get("https://agr.afa.gov.tw/afa/afa_frame.jsp")
print(r.text)

執行結果:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> 
== RESTART: C:/Users/cheng-min/AppData/Local/Programs/Python/Python38/test.py ==


<html>

<head>

<title>農情報告資源網</title>

<style type="text/css">

<!--

td {

	font-family: 新細明體;

	font-size: 13px;

	line-height: 14pt;

	color: #000000;

	text-decoration: none;

	}

A{text-decoration:none}

-->

</style>

</head>



<frameset rows="123,*" frameborder="0" border="0" framespacing="0" >

	<frame name="banner" src="banner.jsp" scrolling="no" noresize >

	

	<frameset cols="199,*" >

		<frame name="left_frame" src="afa_menu.jsp" scrolling="auto" frameborder="no" marginwidth="0" marginheight="0" noresize >

		<frame name="main_frame" src="welcome.htm" scrolling="auto" frameborder="no" marginwidth="0" marginheight="0" >

	</frameset>



	<noframes>

		<body bgcolor="#FFFFFF" text="#000000">

		</body>

	</noframes>

</frameset>



</html>


>>> 

在上面程式中,我們發現afa_menu.jsp程式,於是我們再修改三行程式中的get()函式的網址。
程式:
1
2
3
import requests
r = requests.get("https://agr.afa.gov.tw/afa/afa_menu.jsp")
print(r.text)

結果:

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> 
== RESTART: C:/Users/cheng-min/AppData/Local/Programs/Python/Python38/test.py ==
<html>



<head>

<LINK HREF="general/afa.css" TYPE="text/css" REL="STYLESHEET">

<script language="JavaScript" src="general/menu.js"></script>

<title>農情報告資源網_menu</title>

</head>

<BODY leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" 

		bgcolor="#9DC433" bgproperties="fixed"

		style="background-image:url('images/pic_08.jpg'); background-repeat:no-repeat" >



<div position: absolute; left: 0; top: 0>

<script type="text/javascript" language="JavaScript">

/********************************************************************************

Calling the write functions and setting variables

********************************************************************************/

//Variables to set



var oFoldMenu=new foldoutMenuObj('oFoldMenu')

oFoldMenu.substay=true //Should the sub menus stay folded?

oFoldMenu.sub2stay=false //Should the sub2 menus stay folded?

oFoldMenu.sub3stay=false //Should the sub3 menus stay folded?

oFoldMenu.sub4stay=false //Should the sub4 menus stay folded?

oFoldMenu.sub5stay=false //Should the sub5 menus stay folded?

oFoldMenu.sub6stay=false //Should the sub6 menus stay folded?



oFoldMenu.menubetween=8 //The pixel value between the foldoutmenus



oFoldMenu.left=26 //The left position of the menu

oFoldMenu.top=10 //The top position of the menu

oFoldMenu.width=135 //The width of the menu

oFoldMenu.maxheight=0 //The maxheight of the menu, be sure to set this one high enough





//Setting styles, menu location

oFoldMenu.clFold="" //Regular styles for the topDivs

oFoldMenu.clSub="left:22" //Styles for the subDivs

oFoldMenu.clSub2="left:30" //Styles for the sub2Divs

oFoldMenu.clSub3="left:40" //Styles for the sub3Divs

oFoldMenu.clSub4="left:50" //Styles for the sub4Divs

oFoldMenu.clSub5="left:60" //Styles for the sub5Divs



/*oFoldMenu.clCont="position:absolute;" //The cont layer, set position to relative if you want to try and have it inside a layer or whatever

oFoldMenu.clFoldLinks="font-family:新細明體; font-size:9px; text-decoration:none;color:#000000" //The style for the toplinks

oFoldMenu.clSubLinks="font-family:新細明體; font-size:9px; text-decoration:none; color:#000000" //The style for the sublinks

oFoldMenu.clSub2Links="font-family:新細明體; font-size:9px; text-decoration:none; color:#000000" //The style for the sub2links

oFoldMenu.clSub3Links="font-family:新細明體; font-size:9px; text-decoration:none; color:Black" //The style for the sub3links

oFoldMenu.clSub4Links="font-family:新細明體; font-size:9px; text-decoration:none; color:Black" //The style for the sub4links

oFoldMenu.clSub5Links="font-family:新細明體; font-size:9px; text-decoration:none; color:Black" //The style for the sub5links

remark by alexyang */

oFoldMenu.clCont="position:absolute;background-color:#A5CA59" //The cont layer, set position to relative if you want to try and have it inside a layer or whatever

oFoldMenu.clFoldLinks="font-family:新細明體; font-size:12px; text-decoration:none;color:#000000" //The style for the toplinks

oFoldMenu.clSubLinks="font-family:新細明體; font-size:12px; text-decoration:none;color:#333339"; //The style for the sublinks

oFoldMenu.clSub2Links="font-family:新細明體; font-size:12px; text-decoration:none;color:#333339" //The style for the sub2links

oFoldMenu.clSub3Links="font-family:新細明體; font-size:9px; text-decoration:none; color:Black" //The style for the sub3links

oFoldMenu.clSub4Links="font-family:新細明體; font-size:9px; text-decoration:none; color:Black" //The style for the sub4links

oFoldMenu.clSub5Links="font-family:新細明體; font-size:9px; text-decoration:none; color:Black" //The style for the sub5links





//Do not change this line!

oFoldMenu.makeStyle()



//MAIN 1

oFoldMenu.make('top','','','','images/menu_01.gif','')

oFoldMenu.make('sub','◎一般作物查詢','', '')

oFoldMenu.make('sub2','鄉鎮作物查詢','pgcroptown_cond.jsp', 'main_frame')

oFoldMenu.make('sub2','縣市作物查詢','pgcropcity_cond.jsp', 'main_frame')

oFoldMenu.make('sub2','各項作物同期比較查詢','pgcropcomp_cond.jsp', 'main_frame')

oFoldMenu.make('sub2','各項作物種植面積排序查詢','pgcropmeaqty_cond.jsp', 'main_frame')

oFoldMenu.make('sub2','各項作物種植面積排序查詢(全部鄉鎮)','pgcropmeaqty_all_cond.jsp', 'main_frame')

oFoldMenu.make('sub2','各項作物產量排序查詢','pgcropsigqty_cond.jsp', 'main_frame')

oFoldMenu.make('sub2','各類作物種植面積查詢','pgprodmea_cond.jsp', 'main_frame')

oFoldMenu.make('sub2','各項作物種植面積查詢','pgprodcrop_cond.jsp', 'main_frame')

oFoldMenu.make('sub','◎稻作查詢','', '')

oFoldMenu.make('sub2','鄉鎮稻作查詢','pgricetown_cond.jsp', 'main_frame')

oFoldMenu.make('sub2','縣市稻作查詢','pgricecity_cond.jsp', 'main_frame')

oFoldMenu.make('sub2','各項稻作同期比較查詢','pgricecomp_cond.jsp', 'main_frame')

oFoldMenu.make('sub2','各項稻作產量排序查詢','pgricesigqty_cond.jsp', 'main_frame')

oFoldMenu.make('sub2','各項稻作規模別排序查詢','pgricemeaqty_cond.jsp', 'main_frame')

oFoldMenu.make('sub2','各項稻作規模別排序查詢(全部鄉鎮)','pgricemeaqty_all_cond.jsp', 'main_frame')



//MAIN 2

oFoldMenu.make('top','','https://agrstat.coa.gov.tw/sdweb/public/book/Book.aspx','_blank','images/menu_02.gif','')



//MAIN 3

oFoldMenu.make('top','','http://www.afa.gov.tw/cht/index.php?code=list&ids=892','_blank','images/menu_03.gif','')



//MAIN 4

//oFoldMenu.make('top','','http://www.afa.gov.tw/laws_index.aspx?CatID=77','_blank','images/menu_04.gif','')



//MAIN 5

oFoldMenu.make('top','','','','images/menu_05.gif','')

oFoldMenu.make('sub','農情現金救助辦法','http://www.coa.gov.tw/?cat=show_lawcommond&serial=9_cikuo_20040917172144&type=A&code=A14', '_blank')

oFoldMenu.make('sub','歷年現金救助表','download/cashpay1100630.xls', '_blank')

oFoldMenu.make('sub','農業天然災害現金救助系統','http://agrfb.afa.gov.tw/AFA_FB', '_blank')



//MAIN 6

oFoldMenu.make('top','','','','images/menu_06.gif','')

//oFoldMenu.make('sub','台北糧食產業組版稻米推定系統','Pgdownload_fatp.html', 'main_frame')

//oFoldMenu.make('sub','分署版稻米推定系統','Pgdownload_faoffice.html', 'main_frame')

//oFoldMenu.make('sub','縣市版農情報告系統','Pgdownload_facity.html', 'main_frame')

//oFoldMenu.make('sub','鄉鎮版農情報告系統','Pgdownload_fatown.html', 'main_frame')

//oFoldMenu.make('sub','現金救助系統','Pgdownload_fbtown.html', 'main_frame')



//MAIN 7

//oFoldMenu.make('top','','http://tw.yahoo.com/','_blank','images/menu_07.gif','')









oFoldMenu.construct()

</script>



</div>



</BODY>

</HTML>




>>> 

我們發現在表單的程式中,可以查詢鄉鎮作物和縣市作物,分別為:pgcroptown_cond.jsp和pgcropcity_cond.jsp。我們先用查詢縣市作物的網址來測試一下,其畫面如下:

百香果的作物代碼是643,接下來我就來看看這個程式的原始程式:

程式:
1
2
3
import requests
r = requests.get("https://agr.afa.gov.tw/afa/pgcropcity_cond.jsp")
print(r.text)

結果:

   1
   2
   3
   4
   5
   6
   7
   8
   9
  10
  11
  12
  13
  14
  15
  16
  17
  18
  19
  20
  21
  22
  23
  24
  25
  26
  27
  28
  29
  30
  31
  32
  33
  34
  35
  36
  37
  38
  39
  40
  41
  42
  43
  44
  45
  46
  47
  48
  49
  50
  51
  52
  53
  54
  55
  56
  57
  58
  59
  60
  61
  62
  63
  64
  65
  66
  67
  68
  69
  70
  71
  72
  73
  74
  75
  76
  77
  78
  79
  80
  81
  82
  83
  84
  85
  86
  87
  88
  89
  90
  91
  92
  93
  94
  95
  96
  97
  98
  99
 100
 101
 102
 103
 104
 105
 106
 107
 108
 109
 110
 111
 112
 113
 114
 115
 116
 117
 118
 119
 120
 121
 122
 123
 124
 125
 126
 127
 128
 129
 130
 131
 132
 133
 134
 135
 136
 137
 138
 139
 140
 141
 142
 143
 144
 145
 146
 147
 148
 149
 150
 151
 152
 153
 154
 155
 156
 157
 158
 159
 160
 161
 162
 163
 164
 165
 166
 167
 168
 169
 170
 171
 172
 173
 174
 175
 176
 177
 178
 179
 180
 181
 182
 183
 184
 185
 186
 187
 188
 189
 190
 191
 192
 193
 194
 195
 196
 197
 198
 199
 200
 201
 202
 203
 204
 205
 206
 207
 208
 209
 210
 211
 212
 213
 214
 215
 216
 217
 218
 219
 220
 221
 222
 223
 224
 225
 226
 227
 228
 229
 230
 231
 232
 233
 234
 235
 236
 237
 238
 239
 240
 241
 242
 243
 244
 245
 246
 247
 248
 249
 250
 251
 252
 253
 254
 255
 256
 257
 258
 259
 260
 261
 262
 263
 264
 265
 266
 267
 268
 269
 270
 271
 272
 273
 274
 275
 276
 277
 278
 279
 280
 281
 282
 283
 284
 285
 286
 287
 288
 289
 290
 291
 292
 293
 294
 295
 296
 297
 298
 299
 300
 301
 302
 303
 304
 305
 306
 307
 308
 309
 310
 311
 312
 313
 314
 315
 316
 317
 318
 319
 320
 321
 322
 323
 324
 325
 326
 327
 328
 329
 330
 331
 332
 333
 334
 335
 336
 337
 338
 339
 340
 341
 342
 343
 344
 345
 346
 347
 348
 349
 350
 351
 352
 353
 354
 355
 356
 357
 358
 359
 360
 361
 362
 363
 364
 365
 366
 367
 368
 369
 370
 371
 372
 373
 374
 375
 376
 377
 378
 379
 380
 381
 382
 383
 384
 385
 386
 387
 388
 389
 390
 391
 392
 393
 394
 395
 396
 397
 398
 399
 400
 401
 402
 403
 404
 405
 406
 407
 408
 409
 410
 411
 412
 413
 414
 415
 416
 417
 418
 419
 420
 421
 422
 423
 424
 425
 426
 427
 428
 429
 430
 431
 432
 433
 434
 435
 436
 437
 438
 439
 440
 441
 442
 443
 444
 445
 446
 447
 448
 449
 450
 451
 452
 453
 454
 455
 456
 457
 458
 459
 460
 461
 462
 463
 464
 465
 466
 467
 468
 469
 470
 471
 472
 473
 474
 475
 476
 477
 478
 479
 480
 481
 482
 483
 484
 485
 486
 487
 488
 489
 490
 491
 492
 493
 494
 495
 496
 497
 498
 499
 500
 501
 502
 503
 504
 505
 506
 507
 508
 509
 510
 511
 512
 513
 514
 515
 516
 517
 518
 519
 520
 521
 522
 523
 524
 525
 526
 527
 528
 529
 530
 531
 532
 533
 534
 535
 536
 537
 538
 539
 540
 541
 542
 543
 544
 545
 546
 547
 548
 549
 550
 551
 552
 553
 554
 555
 556
 557
 558
 559
 560
 561
 562
 563
 564
 565
 566
 567
 568
 569
 570
 571
 572
 573
 574
 575
 576
 577
 578
 579
 580
 581
 582
 583
 584
 585
 586
 587
 588
 589
 590
 591
 592
 593
 594
 595
 596
 597
 598
 599
 600
 601
 602
 603
 604
 605
 606
 607
 608
 609
 610
 611
 612
 613
 614
 615
 616
 617
 618
 619
 620
 621
 622
 623
 624
 625
 626
 627
 628
 629
 630
 631
 632
 633
 634
 635
 636
 637
 638
 639
 640
 641
 642
 643
 644
 645
 646
 647
 648
 649
 650
 651
 652
 653
 654
 655
 656
 657
 658
 659
 660
 661
 662
 663
 664
 665
 666
 667
 668
 669
 670
 671
 672
 673
 674
 675
 676
 677
 678
 679
 680
 681
 682
 683
 684
 685
 686
 687
 688
 689
 690
 691
 692
 693
 694
 695
 696
 697
 698
 699
 700
 701
 702
 703
 704
 705
 706
 707
 708
 709
 710
 711
 712
 713
 714
 715
 716
 717
 718
 719
 720
 721
 722
 723
 724
 725
 726
 727
 728
 729
 730
 731
 732
 733
 734
 735
 736
 737
 738
 739
 740
 741
 742
 743
 744
 745
 746
 747
 748
 749
 750
 751
 752
 753
 754
 755
 756
 757
 758
 759
 760
 761
 762
 763
 764
 765
 766
 767
 768
 769
 770
 771
 772
 773
 774
 775
 776
 777
 778
 779
 780
 781
 782
 783
 784
 785
 786
 787
 788
 789
 790
 791
 792
 793
 794
 795
 796
 797
 798
 799
 800
 801
 802
 803
 804
 805
 806
 807
 808
 809
 810
 811
 812
 813
 814
 815
 816
 817
 818
 819
 820
 821
 822
 823
 824
 825
 826
 827
 828
 829
 830
 831
 832
 833
 834
 835
 836
 837
 838
 839
 840
 841
 842
 843
 844
 845
 846
 847
 848
 849
 850
 851
 852
 853
 854
 855
 856
 857
 858
 859
 860
 861
 862
 863
 864
 865
 866
 867
 868
 869
 870
 871
 872
 873
 874
 875
 876
 877
 878
 879
 880
 881
 882
 883
 884
 885
 886
 887
 888
 889
 890
 891
 892
 893
 894
 895
 896
 897
 898
 899
 900
 901
 902
 903
 904
 905
 906
 907
 908
 909
 910
 911
 912
 913
 914
 915
 916
 917
 918
 919
 920
 921
 922
 923
 924
 925
 926
 927
 928
 929
 930
 931
 932
 933
 934
 935
 936
 937
 938
 939
 940
 941
 942
 943
 944
 945
 946
 947
 948
 949
 950
 951
 952
 953
 954
 955
 956
 957
 958
 959
 960
 961
 962
 963
 964
 965
 966
 967
 968
 969
 970
 971
 972
 973
 974
 975
 976
 977
 978
 979
 980
 981
 982
 983
 984
 985
 986
 987
 988
 989
 990
 991
 992
 993
 994
 995
 996
 997
 998
 999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
Python 3.8.2 (tags/v3.8.2:7b3ab59, Feb 25 2020, 23:03:10) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license()" for more information.
>>> 
== RESTART: C:/Users/cheng-min/AppData/Local/Programs/Python/Python38/test.py ==
<html>

















<head>

<LINK HREF="general/afa.css" TYPE="text/css" REL="STYLESHEET">

<meta http-equiv="Content-Type" content="text/html; charset=big5">

<meta name="GENERATOR" content="Microsoft FrontPage 4.0">

<meta name="ProgId" content="FrontPage.Editor.Document">

<title>縣市作物查詢</title>

</head>



<script language="JavaScript">



function beforeSubmit()

{

	var theForm = window.document.afa;

	

	theForm.action = 'pgcropcity.jsp';

	

	if(InputCheck(theForm))

		return true;

	else

		return false;

}





function InputCheck(theForm)

{

	if (theForm.year.value == "" || isNaN(theForm.year.value) || Number(theForm.year.value.length) != 3 )

	{

		theForm.year.value = "";

		alert("欄位 \"年度\" 必須為 3 碼數字.");

		theForm.year.focus();

		return false;

	}

	if (!is_Date(theForm.year.value+"0101"))

	{

		theForm.year.value = "";

		alert("欄位 \"年度\" 格式輸入錯誤 .");

		theForm.year.focus();

		return false;	

	}	

	return true;

}





function is_Date(gField)

{

	var yyyy =parseInt(gField.substring(0,3),10)+1911;

	var mm = parseInt(gField.substring(3,5),10);

	var dd = parseInt(gField.substring(5,gField.length),10);

	

	if(isNaN(mm) || isNaN(dd) || isNaN(yyyy)) return false;

	

	gDate=new Date(yyyy,mm-1,dd);

	

	if((gDate.getMonth()+1)!=mm)	return false;



	return true;

}



</script>



<body bgcolor="#F2F8D6">



<div class="DivCondOut">

	<table border="0" width="400" height="40" cellpadding="0" class="HeadTable">

		<tr><td align="center" class="HeadTD">

			縣市作物查詢

		</td></tr>

	</table>

	<hr color="#808080" size="1" width="400">

	<form name = "afa" method="POST">

	<div class="DivCondTbl">

		<table border="0" width="400" frame="box" class="TDFont">

			<tr>

				<td class="TDLable">   年度:</td>

				<td class="TDData">

				<select size="1" name="accountingyear">





						<option value="109">109</option>



						<option value="108">108</option>



						<option value="107">107</option>



						<option value="106">106</option>



						<option value="105">105</option>



						<option value="104">104</option>



						<option value="103">103</option>



						<option value="102">102</option>



						<option value="101">101</option>



						<option value="100">100</option>



						<option value="099">099</option>



						<option value="098">098</option>



						<option value="097">097</option>



						<option value="096">096</option>



						<option value="095">095</option>



						<option value="094">094</option>



						<option value="093">093</option>



						<option value="092">092</option>



						<option value="091">091</option>



						<option value="090">090</option>



						<option value="089">089</option>



						<option value="088">088</option>



						<option value="087">087</option>



						<option value="086">086</option>



				</select>

				</td>

			</tr>

			<tr>

				<td class="TDLable">  期作別:</td>

				<td class="TDData">

					<select size="1" name="item">

						<option value="00">00.裡作</option>

						<option value="01">01.一期作</option>

						<option value="02">02.二期作</option>

						<option value="03">03.全年作</option>

					</select>

					<script type="text/javascript">afa.item.value="03";</script>

				</td>

			</tr>

			<tr>

				<td class="TDLable"> 作物代號:</td>

				<td class="TDData">

					<select size="1" name="crop">



						<option value="001">001.硬質玉米</option>



						<option value="002">002.食用玉米</option>



						<option value="003">003.小麥</option>



						<option value="004">004.</option>



						<option value="005">005.蜀黍(高粱)</option>



						<option value="006">006.大麥</option>



						<option value="007">007.</option>



						<option value="008">008.蕎麥</option>



						<option value="009">009.薏苡</option>



						<option value="099">099.其他雜糧</option>



						<option value="101">101.大豆</option>



						<option value="102">102.落花生</option>



						<option value="103">103.花豆</option>



						<option value="104">104.紅豆</option>



						<option value="105">105.綠豆</option>



						<option value="106">106.米豆</option>



						<option value="107">107.蠶豆</option>



						<option value="199">199.其他豆類</option>



						<option value="201">201.甘藷</option>



						<option value="202">202.樹薯</option>



						<option value="203">203.馬鈴薯</option>



						<option value="301">301.芝麻</option>



						<option value="302">302.棉花</option>



						<option value="303">303.向日葵</option>



						<option value="304">304.油菜子</option>



						<option value="305">305.</option>



						<option value="306">306.生食甘蔗</option>



						<option value="307">307.瓊麻</option>



						<option value="308">308.香水茅</option>



						<option value="309">309.洛神葵</option>



						<option value="310">310.貴黍</option>



						<option value="311">311.仙草</option>



						<option value="312">312.紫蘇</option>



						<option value="313">313.圓藺草</option>



						<option value="320">320.其他短期特作</option>



						<option value="321">321.大甲藺</option>



						<option value="322">322.三角藺</option>



						<option value="323">323.茉莉</option>



						<option value="324">324.秀英</option>



						<option value="325">325.杭菊</option>



						<option value="326">326.油茶</option>



						<option value="327">327.亞麻</option>



						<option value="328">328.苧麻</option>



						<option value="329">329.荖藤</option>



						<option value="330">330.荖花</option>



						<option value="331">331.荖葉</option>



						<option value="332">332.甜菊</option>



						<option value="333">333.羅勒</option>



						<option value="334">334.山葵</option>



						<option value="335">335.黃梔</option>



						<option value="336">336.葛藤</option>



						<option value="337">337.咖啡</option>



						<option value="338">338.通草</option>



						<option value="339">339.愛玉子</option>



						<option value="340">340.南薑</option>



						<option value="399">399.其他長期特作</option>



						<option value="400">400.採種用蔬菜</option>



						<option value="401">401.蘆筍</option>



						<option value="402">402.韭菜</option>



						<option value="403">403.竹筍</option>



						<option value="404">404.金針菜</option>



						<option value="405">405.山蕨</option>



						<option value="406">406.龍鬚菜</option>



						<option value="407">407.山蘇</option>



						<option value="410">410.西瓜</option>



						<option value="411">411.洋香瓜</option>



						<option value="412">412.香瓜</option>



						<option value="413">413.瓜子瓜</option>



						<option value="414">414.草莓</option>



						<option value="415">415.洋蔥</option>



						<option value="416">416.蘿蔔</option>



						<option value="417">417.胡蘿蔔</option>



						<option value="418">418.茭白筍</option>



						<option value="419">419.甘藍</option>



						<option value="420">420.抱子甘藍</option>



						<option value="421">421.結球白菜</option>



						<option value="422">422.不結球白菜</option>



						<option value="425">425.食用番茄</option>



						<option value="426">426.加工番茄</option>



						<option value="430">430.豆薯</option>



						<option value="431">431.牛蒡</option>



						<option value="432">432.波羅門蔘</option>



						<option value="435">435.其他根菜</option>



						<option value="436">436.青蒜</option>



						<option value="437">437.蒜頭</option>



						<option value="438">438.</option>



						<option value="439">439.蔥頭</option>



						<option value="440">440.</option>



						<option value="441">441.</option>



						<option value="442">442.荸薺</option>



						<option value="443">443.蓮藕</option>



						<option value="444">444.結頭菜</option>



						<option value="445">445.蕗蕎</option>



						<option value="446">446.四川榨菜</option>



						<option value="447">447.大心芥菜</option>



						<option value="448">448.慈菇</option>



						<option value="455">455.其他莖菜</option>



						<option value="456">456.大芥菜</option>



						<option value="457">457.蕹菜</option>



						<option value="458">458.芹菜</option>



						<option value="459">459.菠菜</option>



						<option value="460">460.萵苣</option>



						<option value="461">461.莧菜</option>



						<option value="462">462.茼蒿</option>



						<option value="463">463.香芹菜</option>



						<option value="464">464.芫荽</option>



						<option value="465">465.芥藍</option>



						<option value="466">466.茴香</option>



						<option value="467">467.吉康菜</option>



						<option value="470">470.其他葉菜</option>



						<option value="471">471.花椰菜</option>



						<option value="472">472.青花菜</option>



						<option value="473">473.胡瓜</option>



						<option value="474">474.越瓜</option>



						<option value="475">475.冬瓜</option>



						<option value="476">476.苦瓜</option>



						<option value="477">477.茄子</option>



						<option value="478">478.菜豆(豇豆)</option>



						<option value="479">479.毛豆</option>



						<option value="480">480.豌豆</option>



						<option value="481">481.甜椒</option>



						<option value="482">482.辣椒</option>



						<option value="483">483.南瓜</option>



						<option value="484">484.佛手瓜</option>



						<option value="485">485.節瓜(毛瓜)</option>



						<option value="486">486.皇帝豆</option>



						<option value="487">487.扁蒲</option>



						<option value="488">488.絲瓜</option>



						<option value="489">489.黃秋葵</option>



						<option value="490">490.鵲豆(肉豆)</option>



						<option value="491">491.關刀豆</option>



						<option value="492">492.菱角</option>



						<option value="493">493.四季豆</option>



						<option value="499">499.其他果菜</option>



						<option value="501">501.大菜</option>



						<option value="502">502.田菁</option>



						<option value="503">503.大豆(綠肥)</option>



						<option value="504">504.豌豆(綠肥)</option>



						<option value="505">505.魯冰</option>



						<option value="506">506.紫雲英</option>



						<option value="507">507.富貴豆</option>



						<option value="508">508.太陽麻</option>



						<option value="509">509.油菜</option>



						<option value="510">510.鐵虎豆</option>



						<option value="511">511.爬地蘭</option>



						<option value="512">512.埃及三葉草</option>



						<option value="513">513.青皮豆</option>



						<option value="514">514.其他單播</option>



						<option value="515">515.其他混播</option>



						<option value="518">518.耕地造林</option>



						<option value="600">600.果樹苗圃</option>



						<option value="601">601.香蕉</option>



						<option value="602">602.鳳梨</option>



						<option value="603">603.椪柑</option>



						<option value="604">604.柳橙</option>



						<option value="605">605.桶柑</option>



						<option value="606">606.溫洲蜜柑</option>



						<option value="607">607.文旦柚</option>



						<option value="608">608.斗柚</option>



						<option value="609">609.白柚</option>



						<option value="610">610.晚崙西亞橙</option>



						<option value="611">611.檸檬</option>



						<option value="612">612.葡萄柚</option>



						<option value="613">613.金柑</option>



						<option value="614">614.海梨柑</option>



						<option value="615">615.茂谷柑</option>



						<option value="616">616.四季桔</option>



						<option value="617">617.萊姆</option>



						<option value="618">618.其他柑桔</option>



						<option value="619">619.龍眼</option>



						<option value="620">620.本地種芒果</option>



						<option value="621">621.改良種芒果</option>



						<option value="622">622.檳榔</option>



						<option value="623">623.番石榴</option>



						<option value="624">624.</option>



						<option value="625">625.</option>



						<option value="626">626.</option>



						<option value="627">627.木瓜</option>



						<option value="628">628.蓮霧</option>



						<option value="629">629.巨峰葡萄</option>



						<option value="630">630.義大利葡萄</option>



						<option value="631">631.金香葡萄</option>



						<option value="632">632.黑后葡萄</option>



						<option value="633">633.其他葡萄</option>



						<option value="634">634.枇杷</option>



						<option value="635">635.</option>



						<option value="636">636.荔枝</option>



						<option value="637">637.橄欖</option>



						<option value="638">638.楊桃</option>



						<option value="639">639.</option>



						<option value="640">640.蘋果</option>



						<option value="641">641.</option>



						<option value="642">642.番荔枝</option>



						<option value="643">643.百香果</option>



						<option value="644">644.彌猴桃</option>



						<option value="645">645.人心果</option>



						<option value="646">646.可可椰子</option>



						<option value="647">647.可可</option>



						<option value="648">648.酪梨</option>



						<option value="649">649.楊梅</option>



						<option value="650">650.</option>



						<option value="651">651.紅龍果</option>



						<option value="652">652.番荔枝(大目種)</option>



						<option value="653">653.番荔枝(鳳梨釋迦)</option>



						<option value="698">698.其他果樹</option>



						<option value="699">699.</option>



						<option value="701">701.燕麥</option>



						<option value="702">702.其他短期牧草</option>



						<option value="703">703.盤固拉</option>



						<option value="704">704.狼尾草</option>



						<option value="705">705.其他長期牧草</option>



						<option value="801">801.柴胡</option>



						<option value="802">802.山藥</option>



						<option value="803">803.當歸</option>



						<option value="804">804.薄荷</option>



						<option value="805">805.澤瀉</option>



						<option value="806">806.黃芩</option>



						<option value="807">807.桔梗</option>



						<option value="808">808.除蟲菊</option>



						<option value="809">809.麥門冬</option>



						<option value="810">810.地黃</option>



						<option value="811">811.其他藥用</option>



						<option value="901">901.菊花</option>



						<option value="902">902.唐菖蒲</option>



						<option value="903">903.夜來香</option>



						<option value="904">904.大理花</option>



						<option value="906">906.洋桔梗</option>



						<option value="907">907.香石竹</option>



						<option value="908">908.百合</option>



						<option value="920">920.其他短期切花</option>



						<option value="921">921.球根類</option>



						<option value="922">922.種籽類</option>



						<option value="931">931.玫瑰</option>



						<option value="932">932.玉蘭花</option>



						<option value="933">933.蘭花</option>



						<option value="934">934.滿天星</option>



						<option value="935">935.火鶴花</option>



						<option value="936">936.非洲菊</option>



						<option value="937">937.天堂鳥</option>



						<option value="938">938.文心蘭</option>



						<option value="940">940.其他長期切花</option>



						<option value="941">941.苗圃</option>



						<option value="942">942.盆花</option>



						<option value="951">951.洋菇</option>



						<option value="952">952.段木香菇</option>



						<option value="953">953.太空包香菇</option>



						<option value="954">954.草菇</option>



						<option value="955">955.木耳</option>



						<option value="956">956.白木耳</option>



						<option value="957">957.金針菇</option>



						<option value="958">958.蠔菇</option>



						<option value="970">970.其他菇類</option>



					</select>

				</td>

			</tr>

			<tr>

				<td class="TDLable"> 縣市代號:</td>

				<td class="TDData">

					<select size="1" name="city">



						<option value="00">00.全部</option>





						<option value="0001">01.新北市</option>



						<option value="0002">02.宜蘭縣</option>



						<option value="0003">03.桃園市</option>



						<option value="0004">04.新竹縣</option>



						<option value="0005">05.苗栗縣</option>



						<option value="0006">06.臺中市</option>



						<option value="0007">07.彰化縣</option>



						<option value="0008">08.南投縣</option>



						<option value="0009">09.雲林縣</option>



						<option value="0010">10.嘉義縣</option>



						<option value="0011">11.臺南市</option>



						<option value="0012">12.高雄市</option>



						<option value="0013">13.屏東縣</option>



						<option value="0014">14.臺東縣</option>



						<option value="0015">15.花蓮縣</option>



						<option value="0016">16.澎湖縣</option>



						<option value="0017">17.基隆市</option>



						<option value="0018">18.新竹市</option>



						<option value="0020">20.嘉義市</option>



						<option value="0063">63.臺北市</option>



						<option value="0065">65.金門縣</option>



						<option value="0066">66.連江縣</option>



					</select>

				</td>

			</tr>

			<tr>

				<td class="TDLable"></td>

				<td colspan="2" class="TDData">

					<input type="submit" value="送 出" name="btnSend" onClick="return beforeSubmit();" class="InputBtn">

					&nbsp;&nbsp;&nbsp;

					<input type="reset" value="重 設" name="B2" class="InputBtn">

				</td>

			</tr>

		</table>

	</div>

	</form>



</div>



</body>



</html>
>>> 

當送出時,就可以看到結果如下:
從上表可以看出來百香果的故鄉在南投。

沒有留言:

張貼留言