Warrior Forum - The #1 Digital Marketing Forum & Marketplace

Warrior Forum - The #1 Digital Marketing Forum & Marketplace (https://www.warriorforum.com/)
-   Programming (https://www.warriorforum.com/programming/)
-   -   Get Email address from Javascript with Simple HTML Dom (https://www.warriorforum.com/programming/1059157-get-email-address-javascript-simple-html-dom.html)

hassan007 24th March 2015 02:27 PM

Get Email address from Javascript with Simple HTML Dom
 
Hi there,

I was trying to figure this out for more than one day with no success... I am using simple html dom and this is what my code looks like.

Code:

<?php

include('simple_html_dom.php');

$html = file_get_html('http:// zameen. com/Profile/Islamabad-Patiala_Associates-28879-1.html');

$emailid = $html->find('.s:22', 0);

echo $emailid;

?>

This is what Javascript in above link looks like

Code:

<script language="javascript">var stats_data_obj_agent = 'a:1:{s:16:"agent_phone_view";a:1:{i:137839;a:18:{s:4:"ph_v";i:1;s:11:"with_a_logo";i:1;s:8:"featured";i:1;s:5:"loc_2";s:4:"1562";s:5:"loc_3";s:1:"3";s:6:"cat_id";s:1:"3";s:12:"agent_userid";s:6:"137839";s:12:"company_name";s:16:"Test Estate";s:13:"company_phone";s:14:"+1-2345678";s:12:"company_cell";s:14:"+1-2345678";s:13:"company_email";s:22:"abcd1234@gmail.com";s:9:"is_active";i:1;s:9:"curr_code";s:3:"USD";s:5:"actid";N;s:7:"actname";N;s:8:"actphone";N;s:7:"actcell";N;s:8:"actemail";N; } '; </script>
I am new to this so not yet familiar with advance methods. Any help would be appreciated. Thank you!

KirkMcD 24th March 2015 03:35 PM

Re: Get Email address from Javascript with Simple HTML Dom
 
You need to execute the JS.
But anyway, you're not trying to scrape email addresses are you?

hassan007 25th March 2015 08:27 AM

Re: Get Email address from Javascript with Simple HTML Dom
 
I am trying to scrape email and few other values from this page for a local free directory project

KirkMcD 25th March 2015 10:42 AM

Re: Get Email address from Javascript with Simple HTML Dom
 
Yeah, scraping emails is kinda illegal.

Karen Blundell 25th March 2015 11:17 AM

Re: Get Email address from Javascript with Simple HTML Dom
 
that's why it is so much better to use a contact form on a website rather than post a live email address link - don't do it or you'll have people like the OP scraping them and using them for their own nefarious reasons :mad:

rts2271 25th March 2015 07:53 PM

Re: Get Email address from Javascript with Simple HTML Dom
 
Scraping emails on your own site is fine. Scraping them from a domain you do not own can be bad. It is not illegal to scrape emails, the problem comes that unless you have a very slick targeting regex to get your emails your going to have a potential for a ton of dirty emails.Not to mention it is considered bad practice to not have some kind of permission.

Example of good scraping. Software company X is looking for the administrator emails of domains who utilize X brand of software. They use search results obtained from Google to generate a list of people using product X and who have contact info on their page. They use that list and generate a initial contact to those leads. Yes perfectly 100% legal.

Example of bad scraping. Pulling all email addresses of a web page you do not own. Yes perfectly 100% legal.


All times are GMT -6. The time now is 08:02 AM.