Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat is a post_form_id? (using python urllib2)
    primarykey
    data
    text
    <p>I'm interested in writing a python script to log into Facebook and then request some data (mainly checking the inbox). There are few nice examples out there on how to do this. One interesting script i found <a href="http://ruel.me/blog/2011/03/03/scrape-your-facebook-friends-emails-with-python/" rel="nofollow noreferrer">over here</a> and there is some nice example <a href="https://stackoverflow.com/questions/2030652/logging-into-facebook-with-python">on stackoverflow itself</a>. Now i could just copy-paste some of the code i need and get to do what i want, but that wouldn't be a good way to learn. So i am trying to understand what i am actually coding and can't understand some elements of the script in the first example, namely: what is a <strong>post_form_id</strong>?</p> <p>Here is the section of the code which refers to "post_form_id" (line 56-72):</p> <pre><code># Initialize the cookies and get the post_form_data print 'Initializing..' res = browser.open('http://m.facebook.com/index.php') mxt = re.search('name="post_form_id" value="(\w+)"', res.read()) pfi = mxt.group(1) print 'Using PFI: %s' % pfi res.close() # Initialize the POST data data = urllib.urlencode({ 'lsd' : '', 'post_form_id' : pfi, 'charset_test' : urllib.unquote_plus('%E2%82%AC%2C%C2%B4%2C%E2%82%AC%2C%C2%B4%2C%E6%B0%B4%2C%D0%94%2C%D0%84'), 'email' : user, 'pass' : passw, 'login' : 'Login' }) </code></pre> <p>Would you be so kind to tell me what a <strong>post_form_id</strong> is? And accessorily: would you know what the <strong>lsd</strong> key/value stands for?</p> <p>Thanks.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload