How to create a ASP Web Scraping Application

Hello everyone. I am attempting to create a web based application that will mine a website for data to store in a database. I have successfully scraped the web page of my target. The problem is that the first page is a log in page. How can i interact with the scraped page to force it to log in and then go into the data mining procedure. Any and all advice will be greatly appreciated.....
MatrixUnleashedAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lharrispvCommented:
How are you doing the scraping?  Are you sending an HTTP request?  If so can you put the log in information in the body of the request?
0
MatrixUnleashedAuthor Commented:
Yeah i have been reading about the HTTP request but im not sure if that would help me. I want to create a application where at midnight every night it performs a scape of data on the target website. The problem is: In VB i can use a web browser control and input the necessary data into the log in page and invoke a button click to log me in. But the data is spread through multiple pages. From what i have read the scape gives you a hard copy of the information on that one page. I haven't come across a way to interact with the page after it has been scraped.

VB would do what i need but i need this to be available over the internet for multiple people to access.

Detailed information:
I am using a third party web application to track what work my technicians have completed. I need to scrape the data so that I can score them, generate reports, and payroll

Page 1: Log In Page
Page 2: List of Technician's work in a combo box
Page 3: Select job details which are spread out in multiple combo boxes

I hope this help explain what i looking to do. I not looking for the answer but path to the answer. Not afraid of research just want to research the right thing. lol

Thanks
0
MatrixUnleashedAuthor Commented:
Also its a https:// site
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

lharrispvCommented:
Personally I would use the HTTP Request.  I think it will be the easiest way to go.  You should be able to Post a request buidling out the body and headers as needed.  The response will contain the text of the page and you can parse out the results into an excel spread sheet, email, report etc.

You can always use Windows Task Scheduler to call the at midnight or whatever the Unix equiv is.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
MatrixUnleashedAuthor Commented:
Using the HTTP Request will allow you to invoke click member functions and go to other pages? If so do you know where I can find a tutorial on HTTPRequest. I have been searching Google but haven't found a good tutorial....
0
lharrispvCommented:
Well yes and no.. you cannot actually click with it.  Keep in mind that clicking on a link or a form is nothing more then a post being sent.  That means a HTTP request.. so if you know what page you would be going to after you click you can post tot hat page with the informationt hat would be sent after the click.

Try googling it.  There is TONS out there.  That is what I have been doing.  http request scrape content
0
MatrixUnleashedAuthor Commented:
Im going through all of them but none are starting from the beginning... For those of us who knows nothing of HTTP request.... Any suggestions???
0
lharrispvCommented:
0
MatrixUnleashedAuthor Commented:
I dont think the http request works for https sites.... I included a sample i found. I ran it will the sample site then tried mines.
Original Code:    
 
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Try
            Dim fr As System.Net.HttpWebRequest
            Dim targetURI As New Uri("http://weblogs.asp.net/farazshahkhan")
            fr = DirectCast(System.Net.HttpWebRequest.Create(targetURI), System.Net.HttpWebRequest)
            'In the above code http://weblogs.asp.net/farazshahkhan is used as an example
            'it can be a different domain with a different filename and extension
            If (fr.GetResponse().ContentLength > 0) Then
                Dim str As New System.IO.StreamReader(fr.GetResponse().GetResponseStream())
                Response.Write(str.ReadToEnd())
                str.Close()
            End If
        Catch ex As System.Net.WebException
            Response.Write("File does not exist.")
        End Try
    End Sub
 
 
 
 
 
 
 
 
Changed Code:
    
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Try
            Dim fr As System.Net.HttpWebRequest
            Dim targetURI As New Uri("https://technet.csgsystems.com/hou1/tn/technet.htm?Id=1")
            fr = DirectCast(System.Net.HttpWebRequest.Create(targetURI), System.Net.HttpWebRequest)
            'In the above code http://weblogs.asp.net/farazshahkhan is used as an example
            'it can be a different domain with a different filename and extension
            If (fr.GetResponse().ContentLength > 0) Then
                Dim str As New System.IO.StreamReader(fr.GetResponse().GetResponseStream())
                Response.Write(str.ReadToEnd())
                str.Close()
            End If
        Catch ex As System.Net.WebException
            Response.Write("File does not exist.")
        End Try
    End Sub

Open in new window

0
lharrispvCommented:
From MSDN
http://msdn.microsoft.com/en-us/library/system.net.httpwebrequest.aspx

Do not use the HttpWebRequest constructor. Use the WebRequest..::.Create method to initialize new HttpWebRequest objects. If the scheme for the Uniform Resource Identifier (URI) is http:// or https://, Create returns an HttpWebRequest object.

0
selvolCommented:
Here is the answer. And not some plug trying to sell you something.

I only describe what I have found myself whilt using the software over the last 6 years.

Offline explorer  enterprise.  
Free 30 Day Full Featured Trial.

If you need to scrub your harvest.
OE will intergrate with "TEXTPIPE" and clean/ format the files.
NO FULL TRIAL for Textpipe.


Now OE Enterprise is very powerfull.
NOT SOME 1/2 Butted software for KIDS to get myspace profiles.
But it will do that  


#1 Info ripper/ harvester I have come across.

At first you will not see the full potential.
Don't get discuraged.
This software can do what you want. You just have to learn how to teach the software.
Enterprise can D/load Millions of URL with the push of a button.

The scripts/commands will emulate PHP like URL rewriting.
You can
Tell it to start at
http://joessite.xxx/1{:000000..999999}.php

And it will Dl-oad 1 millions pages from joessite.
Add filters like keywords, text, dir,

I can go on for a while.

Oh yea it will login too.
At Midnight and Not get Copies of the page you already have.

If you are serious about your harvest.
I suggest you get OE enterprise

This app will do more then you need ...

100,000,000 pages downloaded with it  myself...

No I don't get paid to promote this company.
http://www.metaproducts.com/mp/Offline_Explorer_Enterprise.htm
0
MatrixUnleashedAuthor Commented:
Thanks but i would like to do this project myself not just for completion but for the learning as well. I really feel the others comments are putting me on the right track. I successfully scraped ....
0
MatrixUnleashedAuthor Commented:
(cont)... my target but im reading and reading but cant understand how to login with the targetd page not an asp?
0
lharrispvCommented:
Matrix,

Glad to hear my advice is working so far.  Here is some more info for you.  It is C# but it should give you a place to start.  I skimmed it rather then reading it fully but it looks like they are using http.webclient to log in.  Might be that you have to log in first then send the request.. any way here is the link.  Check it out and let me know what you think.

http://forums.asp.net/p/1441206/3270169.aspx
0
lharrispvCommented:
Matrix.. how is this going?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.