dousi2553 2016-09-27 11:56 采纳率: 0%
浏览 35

从网址url查找电子邮件地址[关闭]

I want to find website email address(like name@example.com) from website url link.
so, is it possible to find email address from website url ?
if yes then, please share how to implement.
Language is not necessary.

as per my view,
if we read content from website url using CURL, and
find email address from them using regular expression.
is it possible ?

find bellow code for read page content from website url using CURL:

<?php
$url = 'yoururl';
$curl = curl_init();
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);
curl_setopt($curl, CURLOPT_HEADER, false);
$data = curl_exec($curl);
curl_close($curl);

after then find email address using regex expression from $data string.

Is it possible ?

  • 写回答

2条回答 默认 最新

  • douhuanglou1445 2016-09-27 12:06
    关注

    An easy regexp on the top of my head.

    preg_match_all("/([a-z0-9\.]{1,50}@[a-z0-9]{1,50}\.[a-z]{1,5})/ims",$data,$matches)
    
    评论

报告相同问题?