0

I am a total newbie at this, and always, when trying to workout how to do things, I do a google search, and when it's C# related, I always end up at StackOverflow..

I could not find the answer to my question.

I want to try to login to http://racingpost.com

When at this site, I click the Sign In button, and then, its not a popup as such, but it just feels like its a small form that appears in the page - I have no idea how to show you because I can't post an image..

The little form is just a simple pair of textboxes asking for my email and my password, and then there is a Sign In button..

First, I don't know how to use code to bring this login form up from the site Second, I don't know how to send the credentials into the form and submit this data

The idea is, I want to be able to use the data available as a member of racing post, and I want to grab this data using a winforms application. I know how to do all that, once I am in, but I just have no idea how to get in..

Here is what I have done...

Create a winforms App (VS 2010) Added a webbrowser Set the URL to http://racingpost.com Set ScripErrorsSuppressed to true.

This works fine, for the main site, without login..

BUT, when I click the Sign In button, I then get what looks to be a popup, and it is a small box, with a spinning circle - I also have to click the sign in button twice to get this to come up..

Any help is appreciated

Thanks

Mark.

Mark
  • 11
  • 3
  • I assume you want to login and get the data automatically, ie. without the user having to click the sign in button and enter his credentials? Then you won't need the browser component, but you'll have to "reverse engineer" the calls and execute them via for instance [HttpClient](https://msdn.microsoft.com/de-de/library/system.net.http.httpclient(v=vs.118).aspx) – derpirscher Mar 23 '16 at 19:16
  • Hi, I do not have a clue how to use this to get what I want. Thanks for the response, but I cannot use this. I am the user - the only user, it is my account on racingpost, and I want to login and get the required data BUT, I cant get past step 1 - Login... – Mark Mar 23 '16 at 19:26
  • Do you want to do it interactively, ie you have to click, enter your credentials and navigate the site, but only inside you browser component instead of your browser, or do you want to do it automatically, ie. you have some settings file with your credentials and just press a button and your app automatically logs in to the site and grabs the required data, without displaying the site? – derpirscher Mar 23 '16 at 19:28
  • Ideally, I would like to do as you have asked. Once in, I can use standard navigation, because I will then be a logged in user and can go to members only pages - I am able to do all of this (very simple), so don't need help on that. public string getdatastring(string link) { HttpWebRequest myRequest = (HttpWebRequest)WebRequest.Create(link); myRequest.Method = "GET"; WebResponse myResponse = myRequest.GetResponse(); StreamReader sr = new StreamReader(myResponse.GetResponseStream(), System.Text.Encoding.UTF8); string s = sr.ReadToEnd(); return s; } – Mark Mar 23 '16 at 19:54
  • You can do a login (even with cookies and so on) and navigation also with a HttpWebRequest, if you know the URL of the login request (check with for instance WebInspector in Chrome). No need for a browser control. A working example is shown in the answer to [this question](http://stackoverflow.com/questions/17183703/using-webclient-or-webrequest-to-login-to-a-website-and-access-data) – derpirscher Mar 23 '16 at 20:00
  • And theoretically, the browser control is just a managed wrapper around IE (not sure which version, though). So if the site works in IE, it _should_ work in the browser control as well. – derpirscher Mar 23 '16 at 20:01

0 Answers0