Advertisement

06.18.2007 at 03:58AM PDT, ID: 22640183
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.2

Using the WebClient to post a form and screen scrape some data (not working)

Asked by JenniQ in PHP Scripting Language, Programming for ASP.NET, WebApplications

Tags: , , , ,

Hi,

I'm trying to build an application that accepts a user name and password for MySpace and scrapes some of the user meta data from the user account. The intended use of this program is legal and legitimate.

Ideally I need to write the code in ASP.NET (C#), but if you have something like this you've done in PHP or some other language I could use that as a sample and convert it to asp.net.

.NET has a couple namespaces that should easily accomplish this. They are the WebRequest and WebClient classes (System.Net.HttpWebRequest, System.Net.WebClient). I tried using this code,but when the form submits, even though the user credentials are correct it returns a page that says "You must login!". Its obviously not working:

        string email = "jenni@myspace.com";
        string password = "secretPassword";
        string formUrl = "http://login.myspace.com/index.cfm?fuseaction=login.process";
       
         WebClient client = new WebClient();
        Stream stream;
        StreamReader streamReader;
        System.Collections.Specialized.NameValueCollection collection =
            new System.Collections.Specialized.NameValueCollection();

        collection.Add("email",email);
        collection.Add("password",password);
        collection.Add("loginbutton", "loginbutton");

        client.QueryString = collection;
        stream = client.OpenRead(formUrl);
        streamReader = new StreamReader(stream);

        Response.Write(streamReader.ReadToEnd());

        streamReader.Close();
        stream.Close();

Maybe I'm missing a parameter or maybe its the method of post I'm using? I dunno how to change it form post/get , or if that would even make difference.

Thanks!Start Free Trial
 
Keywords: Using the WebClient to post a form and…
 
Loading Advertisement...
 
[+][-]06.18.2007 at 04:07AM PDT, ID: 19305950

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: PHP Scripting Language, Programming for ASP.NET, WebApplications
Tags: post, screen, webclient, form, scrape
Sign Up Now!
Solution Provided By: alain34
Participating Experts: 2
Solution Grade: A
 
 
[+][-]06.18.2007 at 04:50AM PDT, ID: 19306157

Assisted solutions are selected by the member who asked the question as a comment that contributed to their question's solution.

Start your 7-day free trial to view this Assisted Solution or ask the Experts your question.

 
[+][-]06.18.2007 at 11:26AM PDT, ID: 19309295

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.19.2007 at 12:15AM PDT, ID: 19313830

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.19.2007 at 01:13AM PDT, ID: 19314011

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.13.2008 at 07:57AM PDT, ID: 21779595

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]06.17.2008 at 07:21PM PDT, ID: 21809524

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32