[attach]16004[/attach]
Download NetTransport
right click copy URL to Clipbroad
h ttp://tw.mjjq.com/pic/20081029/mb-qingdao-photo-24.jpg
ht tp://tw.mjjq.com/pic/20081029/mb-qingdao-photo-11.jpg
h ttp://tw.mjjq.com/pic/20081029/mb-qingdao-photo-05.jpg
h ttp://tw.mjjq.com/pic/20081029/mb-qingdao-photo-07.jpg
h ttp://tw.mjjq.com/pic/20081029/mb-qingdao-photo-08.jpg
h ttp://tw.mjjq.com/pic/20081029/mb-qingdao-photo-09.jpg
ht tp://tw.mjjq.com/pic/20081029/mb-qingdao-photo-10.jpg
h ttp://tw.mjjq.com/pic/20081029/mb-qingdao-photo-23.jpg
h ttp://tw.mjjq.com/pic/20081029/mb-qingdao-photo-14.jpg
h ttp://tw.mjjq.com/pic/20081029/mb-qingdao-photo-01.jpg
h ttp://tw.mjjq.com/pic/20081029/mb-qingdao-photo-02.jpg
h ttp://tw.mjjq.com/pic/20081029/mb-qingdao-photo-06.jpg
h ttp://tw.mjjq.com/pic/20081029/mb-qingdao-photo-16.jpg
ht tp://tw.mjjq.com/pic/20081029/mb-qingdao-photo-15.jpg作者: cji3cj6xu6 時間: 2013-9-10 15:06
Option Explicit
Sub 下載網路照片()
Dim a As Variant, e As Integer, i As Integer, s As Variant, p As Integer
With CreateObject("Microsoft.XMLHTTP")
.Open "get", "http://blog.mjjq.com/archives/1975.html", False
.send
a = Split(.responseText, vbLf)
End With
With ActiveSheet
.Pictures.Delete
.Cells.Clear
i = 1
For e = 0 To UBound(a)
If InStr(a(e), "src=""http://") And InStr(a(e), ".jpg"" /><br />") Then
s = Split(a(e), "alt=""")(1)
s = Split(s, """ width=""")(0)
.Cells(i, 1) = s
s = Split(a(e), "src=""")(1)
s = Split(s, """ /><br />")(0)
.Cells(i, 2) = s
p = .Pictures.Count
.Cells(1 + (p * 20), "H").Select
' .Pictures.Insert (.Cells(i, 2))
i = i + 1
End If
Next
End With
End Sub作者: wufonna 時間: 2013-9-10 19:24
s = "<meta name=""description"" content=""提供最方便的網站搜尋、即時新聞、生活資訊和Yahoo奇摩服務入口。"">"""
MsgBox s
End Sub
複製代碼
作者: wufonna 時間: 2013-9-12 14:32
請問G大
split 後面的(1)是刪字元前的全部
(0)刪字元後的全部嗎
謝謝
Sub Ex()
Dim s As String, i, ss As String
s = """"
MsgBox s
s = "A & "" & B"
MsgBox s
s = "<meta name=""description"" content=""提供最方便的網站搜尋、即時新聞、生活資訊和Yahoo奇摩服務入口。"">"
MsgBox s
s = Split(s, "content=""")(1)
MsgBox s
s = Split(s, """>")(0)
MsgBox s
End Sub作者: GBKEE 時間: 2013-9-12 15:03
s = "<meta name=""description"" content=""提供最方便的網站搜尋content=""即時新聞content=""、生活資訊和Yahoo奇摩服務入口。"">"
s = Split(s, "content=""")
MsgBox Join(s, vbLf)
MsgBox UBound(s) '陣列上限元素索引值
For i = 0 To UBound(s)
MsgBox s(i)
Next
End Sub
複製代碼
作者: wufonna 時間: 2013-9-12 15:51
非常謝謝 G 大 ^_^
學生很多問題 /___\
網頁內很多樣式的標籤
可用這樣的方法,還是有什麼方便的方法
Sub test()
Dim a, b, c, d
a = "<img src=""http://l.yimg.com/ud/hp_editor/tw/13/09/12/15/130asf302-190c8a5.jpg"" alt=""Video 圖片"" width=160 height=115><br>"
b = "<img src=""http://l.yimg.com/ud/hp_editor/tw/13/09/12/15/asf912151302190c8a35.jpg"" ></p>"
c = "<img src=""http://l.yimg.com/ud/hp_editor/tw/13/09/12/15/130f302-19c8a35.jpg"" alt=""Video 圖片"" height=115><br />"
d = "<img width=160 height=115 src=http://l.yimg.com/ud/hp_editor/tw/13/09/12/15/13092151302190c8a35.jpg ></a>"
a = Split(a, "http://")(1)
a = Split(a, ".jpg")(0)
a = "http://" & a & ".jpg"
b = Split(b, "http://")(1)
b = Split(b, ".jpg")(0)
b = "http://" & b & ".jpg"
c = Split(c, "http://")(1)
c = Split(c, ".jpg")(0)
c = "http://" & c & ".jpg"
d = Split(d, "http://")(1)
d = Split(d, ".jpg")(0)
d = "http://" & d & ".jpg"
MsgBox a & Chr(10) & b & Chr(10) & c & Chr(10) & d