473,387 Members | 1,520 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Screen Scraping in ASP.NET which need Username and password

hi i need to Screen scrape the smsze.com which required the login page. I need to scrape the page after login so what should i do..
code is as below
Expand|Select|Wrap|Line Numbers
  1. string url = "http://www.smsze.com/logingo.php";         
  2.  
  3.             WebRequest request = WebRequest.Create(url);
  4.  
  5.             request.Method = "POST";
  6.  
  7.             string postData = "mobile=9998471231&pass=xyz&Submit='Sign In'";
  8.  
  9.             byte[] byteArray = Encoding.UTF8.GetBytes(postData);
  10.             request.ContentType = "application/x-www-form-urlencoded";
  11.             request.ContentLength = byteArray.Length;
  12.             Stream dataStream = request.GetRequestStream();
  13.             dataStream.Write(byteArray, 0, byteArray.Length);
  14.             dataStream.Close();
  15.  
  16.             WebResponse response = request.GetResponse();
  17.             dataStream = response.GetResponseStream();
  18.             StreamReader reader = new StreamReader(dataStream);
  19.  
  20.             string responseFromServer = reader.ReadToEnd();
  21.  
  22.             richTextBox1.Text = responseFromServer;
Can you tell me what to do... Pls give me example so that i can better understand. You can also mail me at <email snipped>
Thanks in advance.
Mar 12 '10 #1
1 2472
Frinavale
9,735 Expert Mod 8TB
The experts here on bytes are more than happy to give you a hand with a specific problem that you are having but it's unfair for you to ask a question as vague as "how do you write a program".

The code you've posted looks like it should work...are you having any problems with it? If you are what is the problem? Are you getting any error messages? What have you tried to solve the problem?

By the sounds of it you are able to download the content and all you need to do is parse through it and take what you need. In that case you will probably be interested in reading up on the XML Document Object Model (DOM) and maybe the XMLReader class.

-Frinny
Mar 12 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

4
by: Roland Hall | last post by:
Am I correct in assuming screen scraping is just the response text sent to the browser? If so, would that mean that this could not be screen scraped? function moi() { var tag = '<a href='; var...
3
by: Ollie | last post by:
I know you can screen scrape a website using the System.Net.HttpWebResponse & System.Net.HttpWebRequest classes. But how do you screen scrape a secured website (https) that takes a username &...
3
by: _eee_ | last post by:
Does anyone know of a simple code module that can do screen scraping, including simulating user-entered pushbuttons, etc. I can get the first screen on a website with HttpWebRequest, but I need...
14
by: n8 | last post by:
Hi, Hi have to do the followign and have been racking my brain with various solutions that have had no so great results. I want to use the System.Net.WebClient to submit data to a form (log a...
2
by: Victor | last post by:
I'm doing screen scraping by retrieving data from one site and entering into another site. I have a problem with logging into the site. User name and password field contain 'name' property, and...
2
by: Victor | last post by:
Hi, I have a problem with logging into web site via screen scraping. User name and password field contain 'name' property, and therefore I can easily do assignment to them:...
0
by: Steve | last post by:
I am working on an application to screen scrape information from a web page. I have the base code working but the problem is I have to login before I can get the info I need. The page is hosted on...
12
by: martin.lanny | last post by:
I need to grab a html source code from the second page after I hit this login screen with inserted variables: example: https://www.mypage.com/login.php?username=joe&password=joepsw will lead...
4
by: apondu | last post by:
I'm trying to screen scrape a site that requires a password. I am using C#.Net, i am new to this and with the information available around on the internet i just put tht information into the...
3
by: ckrows | last post by:
I have been trying to find a sample of this on the internet and i cannot. Scenario: I have an Oracle program, it has a logon screen with username and password, 2nd screen i need to enter a "1" to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.