Scraping Facebook Emails

Discussion in 'Programming' started by sigmatrader, Nov 2, 2012.

  1. #1
    Hello, I have used this script to scrape 200k facebook emails but after sending mailing they do not seem to be converting well?
    How do I scrape users emails from facebook in a more effective way?

    sigmatrader.com/trade.php



    import csv
    import MySQLdb
    import urllib2
    import re
    from time import sleep

    ids = 6300
    b = 0

    while ids > 3:


    url = "http://facebook.com/profile.php?id="+str(ids)

    try:
    u = urllib2.urlopen(url)

    e = re.compile('<title*[^>]*>.*</title*>')
    data = u.read()

    current = e.findall(data)

    if "Unavailable" in current[0] or "Not Found" in current[0]:
    b = 1
    else:

    match = re.search(r'URL=/?([^?>]+)',data)
    #if ("/" in match):
    # match = re.search(r'people/?([^/>]+)',data)


    newemail = str(match.group(1))+"@Facebook.com"
    print newemail
    with open("facebook6300.txt", "a") as myfile:
    myfile.write(newemail + "\n")



    except:
    b = 1
    ids+=1


    Best,

    -THe Sigmatrader Team
     
    sigmatrader, Nov 2, 2012 IP