?
Solved

Programmatically download the first page of a list of websites

Posted on 2008-09-30
2
Medium Priority
?
228 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 1500 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month13 days, 11 hours left to enroll

801 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