Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Racingpost website access help needed

Hi
I'm still in the darkages using Delphi 5 for solving personal problems.
I'm a bit dumb about aspects of the object orinted programming.

My problem is that I don't know how to use Delphi 5 to access the registered user webpages that the racingpost supply.

I would like to know how send the racingpost my username and password from delphi using the NMHTTP component or any other method of connecting to retrieve the webpage I am after and not the 'you must register' web page I fetch.

Thanks in advance(from one going potty searhing the web for an answer)

Marcus.

Comments

  • zibadianzibadian Member Posts: 6,349
    : Hi
    : I'm still in the darkages using Delphi 5 for solving personal problems.
    : I'm a bit dumb about aspects of the object orinted programming.
    :
    : My problem is that I don't know how to use Delphi 5 to access the registered user webpages that the racingpost supply.
    :
    : I would like to know how send the racingpost my username and password from delphi using the NMHTTP component or any other method of connecting to retrieve the webpage I am after and not the 'you must register' web page I fetch.
    :
    : Thanks in advance(from one going potty searhing the web for an answer)
    :
    : Marcus.
    :
    I would advice not to use NMHTTP for this, because it will send your password in plain-text. You can better use the TWebBrowser to go to racingpost. This way you need to enter the password yourself, but it is send using the normal encryption of that site. Your program can "watch over your shoulder by using this code in the OnDocumentComplete() event:
    [code]
    SomeString := IHTMLElement(IHTMLDocument2([blue]WebBrowser1[/blue].Document).body).innerHTML
    [/code]
    Replace the blue part with the name of your TWebBrowser control. You must also add the MSHTML unit to the uses list. The body of the webpage is now copied into SomeString, and can be parsed by the program to get the info you need.
  • MarcusMelMarcusMel Member Posts: 3
    Thanks could you please clarify where the functions IHTMLElement
    and IHTMLDocument2 come from. At this point I am not sure the Delphi 5 WebBrowser will allow me to enter a racingpost username and password as the entry points seem to be generated diferently to the standard Html some Javascript Code perhaps. Will take some time to create a test to see where it leads.


    ---Your reply
    I would advice not to use NMHTTP for this, because it will send your password in plain-text. You can better use the TWebBrowser to go to racingpost. This way you need to enter the password yourself, but it is send using the normal encryption of that site. Your program can "watch over your shoulder by using this code in the OnDocumentComplete() event:
    : [code]
    : SomeString := IHTMLElement(IHTMLDocument2([blue]WebBrowser1[/blue].Document).body).innerHTML
    : [/code]
    : Replace the blue part with the name of your TWebBrowser control. You must also add the MSHTML unit to the uses list. The body of the webpage is now copied into SomeString, and can be parsed by the program to get the info you need.
    :

  • zibadianzibadian Member Posts: 6,349
    : Thanks could you please clarify where the functions IHTMLElement
    : and IHTMLDocument2 come from. At this point I am not sure the Delphi 5 WebBrowser will allow me to enter a racingpost username and password as the entry points seem to be generated diferently to the standard Html some Javascript Code perhaps. Will take some time to create a test to see where it leads.
    :
    :
    : ---Your reply
    : I would advice not to use NMHTTP for this, because it will send your password in plain-text. You can better use the TWebBrowser to go to racingpost. This way you need to enter the password yourself, but it is send using the normal encryption of that site. Your program can "watch over your shoulder by using this code in the OnDocumentComplete() event:
    : : [code]
    : : SomeString := IHTMLElement(IHTMLDocument2([blue]WebBrowser1[/blue].Document).body).innerHTML
    : : [/code]
    : : Replace the blue part with the name of your TWebBrowser control. You must also add the MSHTML unit to the uses list. The body of the webpage is now copied into SomeString, and can be parsed by the program to get the info you need.
    : :
    :
    :
    The TWebBrowser is an interface to the IE, so in many ways it will react as IE does. Those two interfaces are defined in the MSHTML unit. This must be added manually to the uses list.
  • MarcusMelMarcusMel Member Posts: 3
    Brill. That is great relief - thought I would never get it sorted.

    Simple for some and difficult for me.

    Many Many thanks

    May sound a bit over the top but been struggling for sometime on this.


Sign In or Register to comment.