Home > SSIS > Download a web page using SSIS

Download a web page using SSIS


Everyone is playing with web everyday. But for the programmer everyday means millions of web pages adding into web zone. So, we have a lot of resources and if we need some thing from web then we just open web browser and type the URL and download necessary information.

Think about a scenario, we need to download a webpage daily from a website using constant URL.

Here is the SSIS that can help you to achieve this task.

Implementation

Step 1: create a SSIS package

Step 2: Add HTTP connection in connection manager and provide the URL your wish to download

 

 

 

 

 

 

Step 3: Add Script Task component and paste the below given code in it

‘connecting website using HTTP connection manager
Dim nativeObject As Object = Dts.Connections(“HTTP Connection Manager”).AcquireConnection(Nothing)

‘ Create a new HTTP client connection
Dim connection As New HttpClientConnection(nativeObject)

‘Download the html page to your local drive
connection.DownloadFile(“<Drive>:\testing\Bing.html”, True)

Step 4: Execute package and look for Bing.html file in path you have given in the DowndloadFile function

Thanks for reading. Enjoy your download.

Advertisements
  1. Developer
    November 3, 2015 at 9:17 pm

    Thank you. This did work for me on my personal machine. But, it is failing on my work machine. Do you think it would be a firewall issue?

  1. December 29, 2011 at 8:57 am

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: