I want to develop a script which will extract certain information from client side when he enter url for our site.
For exmaple-:If he enter the url www.example.com,the code intiates and extract certain information from the client side.It will be different for each user like facebook email etc.
So I was looking at the option and thinking it is nearly impossible to do so unless I have some kind of javascript code which will execute on client side whenever he visit the site.I am also looking at libraries such as Jsoup,selenium etc but I guess they are only executes locally and it didn't solve my purpose.
The text I want to extract is in iframe and further in tables.So is it possible to write a code (javascript or something else )which I include in our index.php page and it executes on client site,extract the information and store the results in database?
The scenario is if user is already logged in into facebook on the same browser then when he visit my site,it will automatically displays his email id related to facebook.So I want to extract that email id.Any suggestions?
EDIT-->>
I am trying the following code to move to frame and then get the content but it is returning empty content document.
var iframe = document.evaluate('//iframe[contains(@src, \"//my.leadpages.net/forms/5620062778032128/5654100301578240/5645914630782976/html/?lp-in-iframe=1\")]',document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).contentDocument;alert(iframe);
Also if you can guide me through for how can I move to frame and then get it's contents via nodes.Iframe has no id,name etc so I have used xpath way.It is detecting the frame as resulting XpathResult but I am not sure how to move into it and then extract text for various nodes.This has to be in Javascript.