To retrieve the web pages, and parse them for email addresses you should take a look at the following modules:

  1. LWP::Simple - To grab the web pages.
  2. HTML::TokeParser - To parse the HTML.
  3. Email::Find - To find email addresses in plain text.
  4. Email::Valid - To validate the email addresses.
  5. Mail::Bulkmail - For sending out emails.

As for mail addresses, they'll be a lot harder to find due to the number of possible formats they could be in. Try looking for keywords in certain orders (e.g. number, street, city). This will be very difficult and unless you're willing to spend a lot of time on it you probably won't have much luck.

Now, as one of our illustrious members articulately observed, SPAM is bad. It is also, in all probability, not the best way to go about obtaining new customers. Chances are you'll only get blacklisted and obtain a less than desireable reputation. So please consider your methods carefully.

And some extra reading:

That said, I find the Anti-Spam fanatics far more annoying than spam. Flaming a few possible (there are many false postives) spammers on a Perl forum won't do anything to solve the problem. If you want to be productive, write better filters.


In reply to Re: Re: How do I extract contact data from websites? by cjf
in thread how do I extract contact data from websites? by Meisamhe

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.