Menu

Login Facebook using Web-Harvest

Parin
2010-06-14
2012-09-04
  • Parin

    Parin - 2010-06-14

    I tried to login Facebook using Web-Harvest. I used the following xml code to
    login

    <?xml version="1.0" encoding="UTF-8"?>
    <config charset="ISO-8859-1">
    <file action="write" path="homepage.xml" charset="UTF-8">
    <html-to-xml>
    <http method="post" url="[url]http://www.facebook.com/login.php[/url]" cookie-policy="browser">
        <http-param name="email">myemail</http-param>
        <http-param name="pass">mypassword</http-param>
    </http>
    </html-to-xml>
    </file>
    </config>
    

    The homepage.xml (output) file contains the xml code for the login page of
    facebook along with the following lines:

    <h2 class="main_message" id="standard_error">Cookies Required</h2>
    <p class="sub_message" id="standard_explanation">Cookies are not enabled on your browser. Please adjust this in your security preferences before continuing.</p>
    

    I tried all the allowed values for cookie-policy in the http processor of the
    xml code but was unsuccessful.

     
  • newbee

    newbee - 2010-06-14

    In my experience what that means is that your login request was not
    successful. Get firebug and see exactly what requests browser sends to
    facebook during login process. Then do the same thing.

     
  • Parin

    Parin - 2010-06-16

    Hi nakoned,

    I saw through firebug what requests the browser sends to facebook during login
    process. The first 2 requests were as follows:

    1. post request to https://login.facebook.com/login.php?login_attempt=1
    2. get request to http://www.facebook.com/home.php?

    So I modified my code as follows:

    <?xml version="1.0" encoding="UTF-8"?>
    <config charset="ISO-8859-1">
        <http method="post" url="[url]https://login.facebook.com/login.php?login_attempt=1[/url]" cookie-policy="browser">
                <http-param name="email">myemail</http-param>
                <http-param name="pass">mypassword</http-param>
        </http>
        <file action="write" path="loginpage.xml" charset="UTF-8">
            <html-to-xml>
                <http method="get" url="[url]http://facebook.com/home.php?[/url]" cookie-policy="browser">
                </http>
            </html-to-xml>  
        </file>
    </config>
    

    Rest of the requests were for png files, css files and js files.

    Even after modifying my code the output was the same. Please correct me if I
    am wrong.

    Thanks.

     

Log in to post a comment.