1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Can't create Google/Yahoo accounts via httpwebrequest...

Discussion in 'Visual Basic .NET' started by MarketerX, Mar 18, 2012.

  1. MarketerX

    MarketerX Regular Member

    Joined:
    Mar 7, 2010
    Messages:
    398
    Likes Received:
    120
    The POST request's on both these sites to successfully register a new account seem to be sending security token variables that are not accessible in the pages source, but seem to be generated by javascript.

    Is the only solution to use the webbrowser control?? Too slow for what I want to do :(
     
  2. Cynikal

    Cynikal Newbie

    Joined:
    May 11, 2010
    Messages:
    32
    Likes Received:
    8
    You should first download the source of the page.

    I just took a look, and saw all the fields.
     
  3. MarketerX

    MarketerX Regular Member

    Joined:
    Mar 7, 2010
    Messages:
    398
    Likes Received:
    120
    For google accounts, the "KTL" variable is only generated if the user is using a webbrowser that supports JS

    For yahoo accounts, the "pfmo" variable contains a random hash "bag=" that isn't in the page source. Also a few other JS related variables are needed in the post request.

    If you can tell me how to get either of those variables it will help...but yahoo ctually has another 1 that isn't in the page source...
     
    Last edited: Mar 18, 2012
  4. theMagicNumber

    theMagicNumber Regular Member

    Joined:
    May 13, 2010
    Messages:
    345
    Likes Received:
    195
    You can use HttpWebRequest/HttpWebResponse to get the html and a WebBrowser control to execute the java script.
    1)Get the html
    2)Navigate to "about:blank", write the html in the WebBrowser control
    3)Execute the javascript function
    4)Post the data using HttpWebRequest/HttpWebResponse

    I think that there are some JavaScript Evaluator libraries, but i wasn't able to find anything reliable.
     
    • Thanks Thanks x 1
  5. esolution

    esolution Junior Member

    Joined:
    Apr 28, 2013
    Messages:
    165
    Likes Received:
    60
    Occupation:
    Full time Internet Marketer
    Location:
    Dreamland
    Have you put this solution in practice? Did you make it work?
    When you GET the html you also get the specific cookie then you use that same cookie when you post so if you want to load the html in the Web Browser Component before the POST to get the javascript parameters you also have to provide the specific cookies ... I know how to keep cookies separate with http web requests /web client but how do I control cookies with the WebBrowser Component? (I don't want my software to let google store any cookie in the default Internet Explorer cookies location, I don't want cookies for different accounts to be mixed at any point )
    Any ideas? Anyone managed to get the javascript parameters using this mixed solution (or any other solution)??
     
    Last edited: Jun 19, 2013