How to Extract Email Addresses?

avatar33

e-Hustler
Dec 5, 2009
3,838
52
48
Calgary, AB
Guys,

I will be eternally grateful for anybody who can tell me if there is an easy way to extract the 7300 emails from this directory's category (lawyers in Brussels):

Avocats - Bruxelles

I have found a couple softwares that can crawl a website and extract all emails but in this particular case I only need the emails in that specific category.

copy-pasting each one of them would obviously take me an eternity :1zhelp:

Thanks in advance!
 


Code:
import urllib2,re,time
url = 'http://pagesdor.truvo.be/bz_Avocats_Bruxelles-%s.html'
for i in range(1,300):
        try:
                page = urllib2.urlopen(url % i).read()
                datas = re.compile('"([^"]+?@[^"]+?)"').findall(page)
                for data in datas:
                        print data
                time.sleep(10)
        except:
                pass

It's python. lookup how to save to a file, or you can rredirect output to a file.
 
  • Like
Reactions: gutterseo
Code:
import urllib2,re,time
url = 'http://pagesdor.truvo.be/bz_Avocats_Bruxelles-%s.html'
for i in range(1,300):
        try:
                page = urllib2.urlopen(url % i).read()
                datas = re.compile('"([^"]+?@[^"]+?)"').findall(page)
                for data in datas:
                        print data
                time.sleep(10)
        except:
                pass

It's python. lookup how to save to a file, or you can rredirect output to a file.

Nice one , thanks for sharing :banana_sml: