How to get information from another site from my HTML page?

The following is required:

I have an HTML web page and I need to access another site and get something from its source code.

I want to run something like

link = "http://www.google.com";
doc.querySelectorAll('#courses_menu > ul > li > a'); // Apply on the link.

to get what I need from the link and use it!

However, I use the Jetpack slider.

Do I need to do anything with HTTP requests?

+5
source share
4 answers

I think you could pull the whole page with an Ajax request, put the content in a hidden iframe, and then manipulate the DOM in the iframe. Something like (here using jQuery framework)

<iframe id="holder" style="display: none">

<script type="text/javascript">
$("#holder").load("http://www.google.com",function () {
  $link = $("#holder").contents().find("#courses_menu > ul > li > a");
});
</script>
+1
source

Ajax (, jquery) - PHP Web-. - .

- .

+1

, "doc.querySelectorAll('# course_menu > ul > li > a');"

IFrame , src .

<iframe src='pagenamewhichhasresult'/>

0

html-, iframe. - script . , javascript, - -, iframe. script .

0

All Articles