![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| Vista Home Premium 32bit | download all images from a web page Hallo guys. I use this code to download single images from a serie of urls $wc = New-Object System.Net.WebClient $path = "my_path\my_folder\" gc "my_path\urls_list.txt" | % { $file = ([system.IO.Path]::getfilename($_)) $wc.DownloadFile($_,($path+$file)) } but I'd like to know if it's possible to download all the images from a web page. Thanks in advance. |
My System Specs![]() |
| | #2 (permalink) |
| | Re: download all images from a web page You would simply need to parse the downloaded file and look for images in it. Like an IMG SRC flag, then download all the matches. I'm sorry, I don't have time this morning to check this out, but maybe someone else will come along. Marco "sardinian_guy" <guest@xxxxxx-email.com> wrote in message news:1ca0249509651afa3d05ba75b4a235bc@xxxxxx-gateway.com... Quote: > > Hallo guys. > I use this code to download single images from a serie of urls > > $wc = New-Object System.Net.WebClient > $path = "my_path\my_folder\" > gc "my_path\urls_list.txt" | % { > $file = ([system.IO.Path]::getfilename($_)) > $wc.DownloadFile($_,($path+$file)) > } > > but I'd like to know if it's possible to download all the images from a > web page. Thanks in advance. > > > -- > sardinian_guy |
My System Specs![]() |
| | #3 (permalink) |
| | Re: download all images from a web page $ie = new-object -com internetexplorer.application $ie.visible=$true $ie.Navigate("http://msn.com") while($ie.busy) {start-sleep -milli 250} $wb = New-Object System.Net.WebClient $ie.Document.getElementsByTagName("IMG") | foreach { $wb.DownloadFile($_.src, ("$path\"+[io.path]::GetFileName($_.src))) } $wb.dispose() $ie.quit() --- Shay Levy Windows PowerShell MVP http://blogs.microsoft.co.il/blogs/ScriptFanatic PowerShell Toolbar: http://tinyurl.com/PSToolbar s> Hallo guys. I use this code to download single images from a serie of s> urls s> s> $wc = New-Object System.Net.WebClient s> $path = "my_path\my_folder\" s> gc "my_path\urls_list.txt" | % { s> $file = ([system.IO.Path]::getfilename($_)) s> $wc.DownloadFile($_,($path+$file)) s> } s> but I'd like to know if it's possible to download all the images from s> a web page. Thanks in advance. s> |
My System Specs![]() |
| | #4 (permalink) |
| | Re: download all images from a web page On Aug 16, 3:01*pm, Shay Levy [MVP] <n...@xxxxxx> wrote: Quote: > $ie = new-object -com internetexplorer.application > $ie.visible=$true > $ie.Navigate("http://msn.com") > while($ie.busy) {start-sleep -milli 250} > > $wb = New-Object System.Net.WebClient > > $ie.Document.getElementsByTagName("IMG") | foreach { > * *$wb.DownloadFile($_.src, ("$path\"+[io.path]::GetFileName($_.src))) > > } > > $wb.dispose() > $ie.quit() > > --- > Shay Levy > Windows PowerShell MVPhttp://blogs.microsoft.co.il/blogs/ScriptFanatic > PowerShell Toolbar:http://tinyurl.com/PSToolbar > > s> Hallo guys. I use this code to download single images from a serie of > s> urls > s> > s> $wc = New-Object System.Net.WebClient > s> $path = "my_path\my_folder\" > s> gc "my_path\urls_list.txt" | % { > s> $file = ([system.IO.Path]::getfilename($_)) > s> $wc.DownloadFile($_,($path+$file)) > s> } > s> but I'd like to know if it's possible to download all the images from > s> a web page. Thanks in advance. > s> ERROR: You cannot call a method on a null-valued expression. ERROR: At line:20 char:34 ERROR: + $ie.Document.getElementsByTagName( <<<< "IMG") | foreach { Not at all sure what it means. OldDog |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
|  Why have images on any web·page, why not Google·Groups too ? | Live Mail | |||
| Windows 7 RC download page goes up early, coming in May | Vista News | |||
| Page-up gets stuck when attempting to scroll over images | Live Mail | |||
| need help quick!! i cant download images, bar code, in Email, | Browsers & Mail | |||
| increasing time to allow web sites to download page | Vista General | |||