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

[µo°Ý] ¹Ï¤ùªººô­¶,¦³¿ìªk¥Îµ{¦¡¤U¸ü¶Ü?©Î¬O¥i¥HÂର¤å¦r?

[µo°Ý] ¹Ï¤ùªººô­¶,¦³¿ìªk¥Îµ{¦¡¤U¸ü¶Ü?©Î¬O¥i¥HÂର¤å¦r?

ºô§}¦p¤U:
https://www.iyp.com.tw/search.php?a_id=5&k=%E9%A4%90%E5%BB%B3
¥D­nÃø«×¦b©ó,¹q¸Ü+¦a§}³£¬O¹Ï¤ù
Q1:¦³¿ìªk§ì¨ì¤å¦rªº¹q¸Ü©Î¬O¦a§}¶Ü?
Q2:§ì¤£¨ì¤å¦r,¥i¥H§ì¹Ï¤ù¶Ü?

¤p§Ìªº»Ý¨D¬O§ì¤½¥q¦WºÙ¡B»¡©ú¡B¦a§}¡B¹q¸Ü
¤S³Â·Ð¦U¦ì¤j¤j¤F!
PKKO

¥»©«³Ì«á¥Ñ GBKEE ©ó 2016-8-20 10:09 ½s¿è

¦^´_ 1# PKKO

¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Const Img = "d:\Tel.jpg"
  3. Sub Ex_()
  4.     Dim i As Integer, E As Object, a, St As String, x As Integer, Sh As Worksheet
  5.     St = "search/"
  6.     Set Sh = ActiveSheet
  7.     With Sh
  8.         .Cells.Clear
  9.         .Pictures.Delete
  10.         .Columns("A:A").ColumnWidth = 29.25
  11.         .Columns("B:B").ColumnWidth = 33.13
  12.         .Columns("C:C").ColumnWidth = 28.5
  13.         .Cells.RowHeight = 19.5
  14.     End With
  15.     With CreateObject("InternetExplorer.Application")
  16.         .Visible = True
  17.         .Navigate "https://www.iyp.com.tw/search.php?a_id=5&k=%E9%A4%90%E5%BB%B3"
  18.         Do While .Busy Or .readyState <> 4: DoEvents: Loop
  19.         With .Document
  20.             For Each a In .getElementByID("search-res").all.TAGS("LI")
  21.                 If a.ID <> "" Then
  22.                     i = i + 1
  23.                     With a
  24.                         Sh.Cells(i, "a") = .all.TAGS("A")(0).INNERTEXT
  25.                         Sh.Cells(i, "d") = .all.TAGS("A")(0).href
  26.                         Set E = .all.TAGS("SPAN")(2)
  27.                         With Sh.Cells(i, "B")
  28.                             .Cells = Split(E.outerHTML, """>")(0)
  29.                             x = InStr(.Cells, St)
  30.                             .Cells = Mid(.Cells, x + Len(St))
  31.                         End With
  32.                         ¤U¸üºô¸ô¹Ï¤ù .all.TAGS("IMG")(0).href
  33.                         With Sh.Cells(i, "C")
  34.                             .Select
  35.                             Set E = Sh.Pictures.Insert(Img)
  36.                             E.Height = .Cells.Height                      '·Ó¤ùªº¥k¤è¦b¤u§@ªí¤Wªº¦ì¸m
  37.                             E.Width = .Cells.Width
  38.                         End With
  39.                     End With
  40.                 End If
  41.             Next
  42.         End With
  43.         .Quit        'Ãö³¬ºô­¶
  44.     End With
  45.     If Dir(Img) <> "" Then Kill Img
  46. End Sub
  47. Private Sub ¤U¸üºô¸ô¹Ï¤ù(Url As String)
  48.     Dim xml As Object     '¥Î¨Ó¨ú±oºô­¶¸ê®Æ
  49.     Dim stream                  'As ADODB.stream   '¥Î¨ÓÀx¦s¤G¶i¦ìÀÉ®×
  50.     Set xml = CreateObject("Microsoft.XMLHTTP")
  51.     Set stream = CreateObject("ADODB.stream")
  52.     xml.Open "GET", Url, 0
  53.     xml.send
  54.     With stream
  55.         .Open
  56.         .Type = 1
  57.         .write xml.ResponseBody
  58.         If Dir(Img) <> "" Then Kill Img
  59.         .SaveToFile (Img)
  60.         .Close
  61.     End With
  62. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# GBKEE


    ·PÁ¶Wª©¤j¤j...¹ê¦b¤Ó¼F®`...¤p§Ì³\¦hµ{¦¡½X³£¬O»P±z¾Ç²ß
¥Ø«e°õ¦æ²Ä¤@µ§¦¨¥\
²Ä¤Gµ§«h¬O¥d¦bImgªº¦a¤è,¦oÅã¥ÜªºµwºÐ¦ì¸m¬°D±ä,¦Ó¤p§Ì¹q¸£¥u¦³³æ¤@C±ä

µy±ß¬ã¨s¤@¤U,·PÁ¤j¤j!
PKKO

TOP

¦^´_ 3# PKKO

­n¬¡¥Î,³o¸Ì§ï¤@¤U
  1. Const Img = "C:\Tel.jpg"
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 4# GBKEE


    ·PÁ¶Wª©¤j¤j,¨Sª`·N¨ì­ì¨Ó¦b³Ì¤W­±
³Ñ¤Uªº¤p§Ì´N¨Ó«ôŪ¤@¤Uµ{¦¡½X¤F,ÁÂÁ±z!
PKKO

TOP

        ÀR«ä¦Û¦b : ¤H¥Í³Ì¤jªº¦¨´N¬O±q¥¢±Ñ¤¤¯¸°_¨Ó¡C
ªð¦^¦Cªí ¤W¤@¥DÃD