I want to to get data within divs from other websites.
How can I do that using JavaScript?
I want to to get data within divs from other websites. How can I
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Due to cross domain restrictions you can’t access the html directly using AJAX.
You can however use
Yahoo YQLto select the part(s) of a page you want and have that html returned withinjsonpdata.Example returning list of questions on main page of stackoverflow
DEMO: http://jsfiddle.net/NTUx5/
YQL docs: http://developer.yahoo.com/yql/guide/index.html
EDIT: This does not work any more.