ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

§U¯èªA°È¶Oiqy¬d¸ß

§U¯èªA°È¶Oiqy¬d¸ß

Dear ¦U¦ì¥ý¶i,

¦¹ºô¯¸ªºiqy¬d¸ß¤]¼g¤F´X¦¸¤F¡A¦ý¬O¤U­±³o­Ó¤@ª½°­¥´Àð¼g¤£¥X¨Ó
¤£¦n·N«ä¦A½Ð±Ð¦U¦ì¤@­Ó°ÝÃD¡A±ý¬d¸ß¤º®e¦p¤U¡G

ºô§}¡Ghttp://portal.sw.nat.gov.tw/APGQ/GC319?request_locale=zh_TW
²î²í©I¸¹¡G9VDB7
¬d¸ßµ²ªG¡G


«ö·Ó¤§«eªº¸gÅç¡Aiqy§Úªº¼gªk¦p¤U¡G
----------
WEB
1
http://portal.sw.nat.gov.tw/APGQ/GC319!query
queryType=2&vslSign=9VDB7

Selection=1
Formatting=None
----------
¦ý¤@ª½¬d¸ß¤£¨ì¤º®e¡A¦A³Â·Ð¦U¦ì¤F¡A·P¿E¤£ºÉ¡C
Hi~

¦^´_ 1# jewayy

http://portal.sw.nat.gov.tw/APGQ/GC319!query?transportId=&queryType=2&vslSign=9VDB7&shipCoCd=

http://portal.sw.nat.gov.tw/APGQ/GC319!query?transportId=&queryType=2&vslSign=9VDB7&shipCoCd=
¬d¸ßµ²ªG

{"msg":"[°õ¦æ¦¨¥\]","netWgt":10855,"shipName":"WAN HAI 301","clearId":"BCF21153004920","shipCoCd":"1105292","data":[{"berthTime":"2013-11-12T14:42:19","item":1,"portName":null,"vslRegNo":"02V538"},{"berthTime":"2013-11-13T00:00:00","item":2,"portName":"TAIPEI","vslRegNo":"02AN57"},{"berthTime":"2013-11-21T13:56:10","item":3,"portName":null,"vslRegNo":"024173"},{"berthTime":"2013-11-22T14:46:39","item":4,"portName":null,"vslRegNo":"02V717"},{"berthTime":"2013-12-11T18:04:49","item":5,"portName":null,"vslRegNo":"02V942"},{"berthTime":"2013-12-12T18:19:50","item":6,"portName":null,"vslRegNo":"02AP87"},{"berthTime":"2013-12-19T22:28:25","item":7,"portName":null,"vslRegNo":"024531"},{"berthTime":"2013-12-20T22:10:42","item":8,"portName":null,"vslRegNo":"02VB13"},{"berthTime":"2014-01-08T14:35:17","item":9,"portName":null,"vslRegNo":"02VD51"},{"berthTime":"2014-01-09T00:00:00","item":10,"portName":"TAIPEI","vslRegNo":"02AS14"}],"vslSign":"9VDB7","issueCustCd":"BC","timeLimit":"2014-03-11T14:42:19","detailShow":"block","addDate":null,"status":"ok","countryCd":"SG","payNote":"N"}

TOP

¦^´_ 1# jewayy
  1. Option Explicit
  2. Sub §U¯èªA°È¶O¬d¸ß_GC319()
  3.     Dim Element, ²î²í©I¸¹ As String, xi As Integer, i As Integer, k As Integer, j As Integer
  4.     ²î²í©I¸¹ = InputBox("²î²í©I¸¹")
  5.     With CreateObject("InternetExplorer.Application")
  6.        ' .Visible = True
  7.         '.Navigate "http://portal.sw.nat.gov.tw/APGQ/GC319?request_locale=zh_TW"
  8.         .Navigate "http://portal.sw.nat.gov.tw/APGQ/GC319"
  9.         Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
  10.         .Document.getelementbyid("queryType1").Click
  11.         .Document.getelementbyid("vslSign").Value = ²î²í©I¸¹   '"9VDB7"
  12.         For Each Element In .Document.getelementsbytagname("INPUT") '    ³o­Ó°j°é§ä¨ì«ö¶s¬O²Ä´X­Ó¿é¤J¶µ
  13.             If Element.Type = "button" And Trim(Element.Value) = "¬d¸ß" Then
  14.                 Element.Click
  15.                 Exit For
  16.             End If
  17.         Next
  18.         .Document.getelementsbytagname("SELECT")(0).Value = 30               '¸ê®Æ¼Æ
  19.         .Document.getelementsbytagname("SELECT")(0).FireEvent ("onchange")   'Ū¨ú
  20.         Do While .Busy Or .ReadyState <> 4: DoEvents: Loop
  21.         Application.Wait Time + #12:00:02 AM#
  22.         If .Document.getelementbyid("statusMsg").Value <> "[°õ¦æ¦¨¥\]" Then
  23.             MsgBox ²î²í©I¸¹ & vbLf & .Document.getelementbyid("statusMsg").Value
  24.             .Quit
  25.             Exit Sub
  26.         End If
  27.         Set Element = .Document.getelementsbytagname("TABLE") '
  28.         With ActiveSheet
  29.             .UsedRange.Clear
  30.             k = 1
  31.             For xi = 2 To 6
  32.                 If xi <> 3 Then
  33.                     For i = 0 To Element(xi).Rows.Length - 1
  34.                         For j = 0 To Element(xi).Rows(i).Cells.Length - 1
  35.                             .Cells(k, j + 1) = Element(xi).Rows(i).Cells(j).innertext
  36.                     Next
  37.                     k = k + 1
  38.                     Next
  39.                 End If
  40.            Next
  41.         End With
  42.         .Quit
  43.     End With
  44.     MsgBox "Ok"
  45. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

ÁÂÁÂjoey¥H¤ÎGBKEEª©¤jªº¦^ÂСC
¤p§Ì¦³ÂIºÃ°Ý¡A¬°¦ó¤@©w­n¥[shipCoCd³o­Ó±ø¥ó¤~¶]±o¥X¨Ó(ÁÙ¤£¥Îµ¹­È)¡A¤£¬O¤G¿ï¤@¶Ü¡H
Hi~

TOP

        ÀR«ä¦Û¦b : ¤@­Ó¤Hªº§Ö¼Ö¡D¤£¬O¦]¬°¥L¾Ö¦³±o¦h¡A¦Ó¬O¦]¬°¥L­p¸û±o¤Ö¡C
ªð¦^¦Cªí ¤W¤@¥DÃD