Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Programmatically download the first page of a list of websites

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

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

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

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses

618 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