Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Professional For advanced ASP.NET 1.x coders. Beginning-level questions will be redirected to other forums. NOT for "classic" ASP 3 or the newer ASP.NET 2.0 and 3.5
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Professional section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 1st, 2006, 12:55 PM
Registered User
 
Join Date: Nov 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default screen scrape help

i'm trying to screen scrape a webpage developed using .Net. user enters a zipcode in the first page and submits which goes to second page which displays if the zipcode is valid/invalid. So the second page should be screen scraped. so all the zipcodes to be entered in first page will be picked from database en the screenscrape results should be stored back into database(i.e valid/invalid). My problem is how to get the actual URL of first page because zipcode should be appended as a parameter to the URL. i tried doing this but the page is not getting submitted along with zipcode....so it's remaining in the first page only.Any help would be appreciated. thanks

 
Old November 1st, 2006, 01:10 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

What part of the scrape are you having problems with?? Just a problem appending the user entered zipcode to the URL?

In its simplest form you could do:

WebClient objWebClient = new WebClient();
string strURL = "http://www.secondpage.com?url=" + txtZipCode.Text ;
UTF8Encoding objUTF8 = new UTF8Encoding();
lblOutput.Text = objUTF8.GetString(objWebClient.DownloadData(strURL ))


-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature
 
Old November 1st, 2006, 03:45 PM
Registered User
 
Join Date: Nov 2006
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for your quick response, Actually i'm using VBScript for this screen scrape process. The script works fine for any other website like yahoo,cingular etc but the site which i'm trying for is http://www.t-mobile.com/locator.aspx...2fDefault.aspx
Here you enter ZIP Code and submit page

  If valid, redirects to http://www.t-mobile.com/Default.aspx

  If invalid, redirects to http://www.t-mobile.com/locator.aspx? referer=http%3a%2f%2fwww.t-mobile.com%2fDefault.aspx

so when i append zipcode to first URL it should be submitted to
second URL and here i do the screen scraping. but when i try appending zipcode=21071 to first URL it's not submitting to second page instead displays the first page only. Please help me solve this problem.


 
Old November 1st, 2006, 03:57 PM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

What are you trying to do, the store locator or the coverage area? For the coverage area you would use the below URL to pull up the map:

http://www.t-mobile.com/coverage/default.aspx?zip=44301

Where 44301 is the zipcode from your application.

If I go to the page: http://www.t-mobile.com/locator.aspx...2fDefault.aspx there is a text box there to provide my Zipcode but there isnt a zip code passed via the querystring when you enter or are redirected to the index. It looks like the page is setting a cookie or setting a variable in session to hold that zip code when the user posts the form.

To that end, what you need to do is write a bot that goes to that page, inputs the zip code, and posts the form back to T-Mobiles server THEN scrape the screen. What you are doing isn't causing the form to post or the zip code to be passed in, all it is doing is sending a zip code ot the page which the application is ignoring.

-------------------------
I will only tell you how to do it, not do it for you.
Unless, of course, you want to hire me to do work for you.

^^Thats my signature





Similar Threads
Thread Thread Starter Forum Replies Last Post
how can clear the screen the screen malli_kv2 BOOK: Beginning Java 2, JDK 5 Edition 4 January 17th, 2009 12:43 AM
print screen jasonsjones Visual Basic 2005 Basics 1 May 21st, 2007 06:37 AM
Draw on the screen without clearing the screen pu132 Visual Basic 2005 Basics 0 August 25th, 2006 09:03 PM
screen resolution miguel.ossa C# 2 October 9th, 2004 11:58 PM
Screen Flicker SerranoG Access 1 May 16th, 2004 03:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.