Solved

Programmatically download the first page of a list of websites

Posted on 2008-09-30
2
221 Views
Last Modified: 2012-05-05
I have a list of 400 website URLs and site names.  I want to automatically download just the home page and name the folder by the site name.  Is there a tool or a way in VB.NET?
0
Comment
Question by:Whah
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 4

Accepted Solution

by:
alaran earned 500 total points
ID: 22607336
You could use the HttpWebRequest class.
Loop though each of the URLs, make the request using the HttpWebRequest.Create method.
Then get the response and the response stream. You can then write the response stream fo file or whatever you want to do with the downloaded contents.

C# example, but should be easy to port:

foreach(string theUrl in myUrlList)
{
    HttpWebRequest request = (HttpWebRequest) HttpWebRequest.Create(theUrl);
    WebResponse response = request.GetResponse();
    System.IO.Stream contentStream = response.GetResponseStream();
    // Write the contents to file or something...
}
0
 
LVL 4

Expert Comment

by:alaran
ID: 22607345
You need to import the System.Net namespace by the way.
0

Featured Post

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Since .Net 2.0, Visual Basic has made it easy to create a splash screen and set it via the "Splash Screen" drop down in the Project Properties.  A splash screen set in this manner is automatically created, displayed and closed by the framework itsel…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

726 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question