开发者

Download Pictures from web using webBrowser control

开发者 https://www.devze.com 2023-04-08 09:32 出处:网络
First excuse for my English i\'m from spain. I am a little worried because i cannot been able to finish my project in the school, I am trying to develop an application in visual basic 6 to discharge

First excuse for my English i'm from spain.

I am a little worried because i cannot been able to finish my project in the school, I am trying to develop an application in visual basic 6 to discharge the cd covers (Album Art) from internet using the webbrowser control, i put this path to navigate:

"http://www.google.com.co/search? hl=es开发者_Go百科&safe=active&gbv=2&biw=1280&bih=821&tbm=isch&sa=1&q=%22heroes+del+silencio%22%2B%22avalancha%22%2Balbum+art+small&oq=%22heroes+del+silencio%22%2B%22avalancha%22%2Balbum+art+small&aq=f&aqi=&aql=1&gs_sm=e&gs_upl="

This display the covers that I am needing, but i'm trying to get the first Picture filename or URL and save this direct to a Folder In my Pc, please can some help to me, Thanks...

I will be very grateful for your help


I have written a part of code and you can continue to finish your program. This is a code of sub, which gives you HTML Code of web-pages:

Function GetHTMLCode(strURL As String) As String
Dim objHttp As Object, strText As String
Set objHttp = CreateObject("MSXML2.ServerXMLHTTP")
objHttp.Open "GET", strURL, False
objHttp.setRequestHeader "User-Agent", _
"Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
objHttp.Send ("")
strText = objHttp.responseText
Set objHttp = Nothing
GetHTMLCode = strText
End Function

I have found that all the links of pictures in Google Pictures are starting with this HTML code :
src="http://
and end with this :
"
The links of pictures are between these 2 lines!!!
You can use GetHTMLCode to get all HTML code of current web page.
Then continually find these 2 lines using "instr" function , and download the links between them.
Problem Solved!

Please vote , if my answer is useful :)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号