bluerein Posted November 4, 2008 Share Posted November 4, 2008 Im using _IEImgGetCollection to download a web pages images... What ive found is that _IEImgGetCollection scans the page source and only gets them images in the source ...Is there another way to download every image on the page.. thanks Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 4, 2008 Share Posted November 4, 2008 Im using _IEImgGetCollection to download a web pages images... What ive found is that _IEImgGetCollection scans the page source and only gets them images in the source ...Is there another way to download every image on the page..thanksThe _IE* functions work on the DOM, not the source, which is not quite the same thing.Can you post an example of _IEImgGetCollection() NOT getting all the images? Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
bluerein Posted November 4, 2008 Author Share Posted November 4, 2008 sure.. #include <IE.au3> #include <INet.au3> $loc= @DesktopDir $site="http://www.invisiontuning.com/forum/" sleep(500) $oIE = _IECreate ($site,1,0) $oImgs = _IEImgGetCollection ($oIE) $iNumImg = @extended MsgBox(0,"",$iNumImg & "imagaes found") sleep(500) For $oImg In $oImgs $path = StringReplace($oImg.src,$site & "style_images/",$loc & "\images\") $File = StringMid($oImg.src, StringInStr($oImg.src, "/", 0, -1)+1) $dir = StringReplace($path,$file,"") $dir2= StringReplace($dir,"/","\") DirCreate($dir2) sleep(100) If not FileExists($dir2 & $file) then InetGet($oImg.src, $dir2 & $file, 1, 0) Next _IEQuit ($oIE) just run it!! It says 69 images found (does that include duplicates?) it only gets about 25 or so and if you look at the page there loads its missed Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 4, 2008 Share Posted November 4, 2008 sure.. #include <IE.au3> #include <INet.au3> $loc= @DesktopDir $site="http://www.invisiontuning.com/forum/" sleep(500) $oIE = _IECreate ($site,1,0) $oImgs = _IEImgGetCollection ($oIE) $iNumImg = @extended MsgBox(0,"",$iNumImg & "imagaes found") sleep(500) For $oImg In $oImgs $path = StringReplace($oImg.src,$site & "style_images/",$loc & "\images\") $File = StringMid($oImg.src, StringInStr($oImg.src, "/", 0, -1)+1) $dir = StringReplace($path,$file,"") $dir2= StringReplace($dir,"/","\") DirCreate($dir2) sleep(100) If not FileExists($dir2 & $file) then InetGet($oImg.src, $dir2 & $file, 1, 0) Next _IEQuit ($oIE) just run it!! It says 69 images found (does that include duplicates?) it only gets about 25 or so and if you look at the page there loads its missed Excellent answer! Short, complete, and presumably demonstrates your issue! I don't try out unfamiliar web sites from "Windowsland" here, but when I get to one of my safe machines I'll try it out. Others may be able to check it quicker than that. Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
PsaltyDS Posted November 4, 2008 Share Posted November 4, 2008 (edited) When I run this, I get 69 images and their .src strings. How many were you looking for? #include <IE.au3> #include <INet.au3> $site = "http://www.invisiontuning.com/forum/" $oIE = _IECreate($site, 1) $oImgs = _IEImgGetCollection($oIE) $iNumImg = @extended ConsoleWrite($iNumImg & "imagaes found" & @LF) $n = 0 For $oImg In $oImgs ConsoleWrite("Index " & $n & ": " & $oImg.Src & @LF) $n += 1 Next Edited November 4, 2008 by PsaltyDS Valuater's AutoIt 1-2-3, Class... Is now in Session!For those who want somebody to write the script for them: RentACoder"Any technology distinguishable from magic is insufficiently advanced." -- Geek's corollary to Clarke's law Link to comment Share on other sites More sharing options...
bluerein Posted November 4, 2008 Author Share Posted November 4, 2008 yes 69 is wrong though ... theres more that its not getting...why?? example theres an image called "cathead_right.gif" on the page I used this to view the image names as it looped #include <IE.au3> #include <INet.au3> $loc= @DesktopDir $site="http://www.invisiontuning.com/forum/" sleep(500) $oIE = _IECreate ($site,1,0) $oImgs = _IEImgGetCollection ($oIE) $iNumImg = @extended MsgBox(0,"",$iNumImg & "imagaes found") sleep(500) For $oImg In $oImgs $path = StringReplace($oImg.src,$site & "style_images/",$loc & "\images\") $File = StringMid($oImg.src, StringInStr($oImg.src, "/", 0, -1)+1) MsgBox(0,"",$file) Next _IEQuit ($oIE) no "cathead_right.gif" returned!! So its missing images then... Link to comment Share on other sites More sharing options...
bogQ Posted November 4, 2008 Share Posted November 4, 2008 dont see how 69 is wrong.theres an image called "cathead_right.gif" on the pageno "cathead_right.gif" returned!!where?i opened page source and on ctrl+f dident finde that picturecan you post ss to see where is located that picture from invisiontuning site pls? TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
bluerein Posted November 4, 2008 Author Share Posted November 4, 2008 (edited) http://www.invisiontuning.com/forum/style_...thead_right.gifno one said its in the source ....This is my point ..I can see it but its not being picked up by _IEImgGetCollectionsorry forgot ss...http://images.supex0.co.uk/out.php/i27_image.png Edited November 4, 2008 by bluerein Link to comment Share on other sites More sharing options...
bogQ Posted November 5, 2008 Share Posted November 5, 2008 (edited) whell tellme how do you plan to get something what you cant get with normal methods, is not in source, its not saved with save as html, it cant b selected with ctrl+a it dont have proporties.what you see is imported from hearehttp://www.invisiontuning.com/forum/style_images/css_6.cssso basicly its not picture from that page even if you see it on it Edited November 5, 2008 by bogQ TCP server and client - Learning about TCP servers and clients connectionAu3 oIrrlicht - Irrlicht projectAu3impact - Another 3D DLL game engine for autoit. (3impact 3Drad related) There are those that believe that the perfect heist lies in the preparation.Some say that it’s all in the timing, seizing the right opportunity. Others even say it’s the ability to leave no trace behind, be a ghost. Link to comment Share on other sites More sharing options...
bluerein Posted November 5, 2008 Author Share Posted November 5, 2008 yes I know all that ... So weve established then that _IEImgGetCollection doesnt get what we see...thats all I nedded to know ...thanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now