Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 24th Mar 2015, 02:27 PM   #1
SpiderCon
War Room Member
 
Join Date: 2012
Location: Earth
Posts: 194
Thanks: 30
Thanked 17 Times in 16 Posts
Default
Get Email address from Javascript with Simple HTML Dom
Share on: 
fb share twitter share gplus share more share

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!
hassan007 is offline  
Unread 24th Mar 2015, 03:35 PM   #2
VIP Warrior
War Room Member
 
Join Date: 2006
Location: , , USA.
Posts: 1,795
Thanks: 70
Thanked 287 Times in 259 Posts
Default
Re: Get Email address from Javascript with Simple HTML Dom
Share on: 
fb share twitter share gplus share more share

You need to execute the JS.
But anyway, you're not trying to scrape email addresses are you?
KirkMcD is offline  
Unread 25th Mar 2015, 08:27 AM   #3
SpiderCon
War Room Member
 
Join Date: 2012
Location: Earth
Posts: 194
Thanks: 30
Thanked 17 Times in 16 Posts
Default
Re: Get Email address from Javascript with Simple HTML Dom
Share on: 
fb share twitter share gplus share more share

I am trying to scrape email and few other values from this page for a local free directory project
hassan007 is offline  
Unread 25th Mar 2015, 10:42 AM   #4
VIP Warrior
War Room Member
 
Join Date: 2006
Location: , , USA.
Posts: 1,795
Thanks: 70
Thanked 287 Times in 259 Posts
Default
Re: Get Email address from Javascript with Simple HTML Dom
Share on: 
fb share twitter share gplus share more share

Yeah, scraping emails is kinda illegal.
KirkMcD is offline  
Unread 25th Mar 2015, 11:17 AM   #5
VIP Warrior
War Room Member
 
Karen Blundell's Avatar
 
Join Date: 2008
Posts: 1,768
Thanks: 4,644
Thanked 1,335 Times in 894 Posts
Default
Re: Get Email address from Javascript with Simple HTML Dom
Share on: 
fb share twitter share gplus share more share

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

---------------
Karen Blundell is offline  
Unread 25th Mar 2015, 07:53 PM   #6
Advanced Warrior
 
Join Date: 2010
Location: Lawrenceville GA
Posts: 685
Thanks: 52
Thanked 153 Times in 117 Posts
Default
Re: Get Email address from Javascript with Simple HTML Dom
Share on: 
fb share twitter share gplus share more share

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.

rts2271 is offline  
Closed Thread


Bookmarks

Tags
address, dom, email, html, javascript, simple


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 04:13 AM.