Capturing a email genetating via javascript

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
troshan
Forum Newbie
Posts: 5
Joined: Wed Jun 24, 2015 11:47 pm

Capturing a email genetating via javascript

Post by troshan »

I'm using "simplehtmldom" to captured the elements.

I want to capture the email address from the following email capture

Image

the email is generating with javascript and It was decoded. So I know I can not capture the email.

I noticed, I couldn't select the "output" or It's child element for some reasons.

Code: Select all

 $myemail = $item->find ('#field_11 .output');
So I captured the whole div by following method

Code: Select all

$myemail = $item->find ('#field_11');
and which out puts the following result.

Image

Firebug screenshot

I guess If I remove the <!-- I'll able to print the value. I was trying to trim the <!-- by follwing method but none of them work

Code: Select all

trim($myemail, "!--//");

Code: Select all

trim(strip_tags($myemail), "!--//");

Code: Select all

trim(htmlentities($myemail), "!--//");
I was trying to decode the result by following functions but none of them work (I guess using REGEX I can extract the email after decode)

Code: Select all

  html_entity_decode

    htmlspecialchars_decode

    utf8_decode
Could anyone help me to achieve what I want? Please ignore if any of my method distract you from providing a right solution.
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: Capturing a email genetating via javascript

Post by Christopher »

It seems like if someone is intentionally trying to obfuscate the email address, then you should not be trying to parse the page to get it...
(#10850)
Post Reply