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

[µo°Ý] §ì¨úºô­¶¸ê®Æ(¼u¥X¦¡µøµ¡)

[µo°Ý] §ì¨úºô­¶¸ê®Æ(¼u¥X¦¡µøµ¡)

¥»©«³Ì«á¥Ñ PKKO ©ó 2016-3-13 12:31 ½s¿è

test.rar (21.79 KB)

ªþ¥ó¸Ì­±¦³¬ÛÃöªºÀÉ®×
¥D­n¬O³sµ²¨ìºô§}¤§«á
·Q­n¤U¸ü¼u¥X¦¡ªºµøµ¡,¸Ì­±ªº¬ÛÃö¸ê®Æ
¦ý¤p§Ì¥Ø«e¥u¯à±Nºô­¶ªº¤º®e¤U¸ü¸ê®Æ
¤£¾å±o¼u¥X¦¡ªºµøµ¡,­n¦p¦ó¤U¸ü¬ÛÃö¸ê®Æ
ÁٽЦU¦ì¤j¤j­Ì«ü±Ð!
PKKO

¦^´_ 1# PKKO

2016-03-13_185457.gif
2016-3-13 18:57
  1. Sub ex1()

  2.     For i = 1 To 30
  3.      
  4.         Cells(i, 4) = Len(Cells(i, 3))
  5.         Cells(i, 5) = InStr(Cells(i, 3), "(")
  6.         Cells(i, 6) = InStr(Cells(i, 3), ")")
  7.         Cells(i, 7) = Mid(Cells(i, 3), Cells(i, 5) + 2, Cells(i, 6) - Cells(i, 5) - 3) '¤½¥q¥N½X

  8.         snum = Cells(i, 7)
  9.         Set HTML = CreateObject("htmlfile")
  10.         
  11.         Dim strText As String
  12.         With CreateObject("WinHttp.WinHttpRequest.5.1")
  13.             .Open "get", "http://www.travel.org.tw/showtable.aspx?id=" & snum, False
  14.             .Send
  15.             strText = .responseText
  16.             
  17.             HTML.body.innerhtml = strText
  18.             Set tb = HTML.all.tags("table")(0).Rows
  19.             
  20.             For x = 1 To 13
  21.                 Cells(i, x + 7) = tb(x).Cells(1).innertext
  22.             Next
  23.         End With

  24.     Next
  25.         
  26.     Cells.EntireColumn.AutoFit
  27. End Sub
½Æ»s¥N½X
test.zip (27.6 KB)

TOP

¦^´_ 2# joey0415


    ·PÁ¤j¤j,¤p§Ì¬ã¨s¤@¤U!
PKKO

TOP

¦^´_ 2# joey0415

¤U¤è³o¬qºô§}¦p¦ó±oª¾ªº?¥B¦p¦ó±oª¾¥L«á­±¥[¤W¥N¸¹§Y¥i¬d¸ß¨ì¸ê®Æ
  1. "http://www.travel.org.tw/showtable.aspx?id=" & snum
½Æ»s¥N½X
¥H¤Î¥ÎIEª½±µ¶}±Ò·|ÅܶýX,¤Ï¦Ó¥Îchrome¥i¥Hª½±µ¬Ý¨ì
ÁÙ¦³¦A½Ð±Ð¤j¤j
  1. Set tb = HTML.all.tags("table")(0).Rows
½Æ»s¥N½X
¤W¤èµ{¦¡½X,±q­þÃä±oª¾¬O­n¥Îtags("table")(0) ©O?

¤p§Ì·M¬NÁٽФj¤j«ü±Ð,ÁÂÁ±z!
PKKO

TOP

        ÀR«ä¦Û¦b : ­n¥Î¤ß¡A¤£­n¾Þ¤ß¡B·Ð¤ß¡C
ªð¦^¦Cªí ¤W¤@¥DÃD