0

I am working on getting specific div data, and trying jQuery.

<!doctype html>
<html lang="en">
<head>
 <meta charset="utf-8">
 <title>load demo</title>
 <style>
 body {
   font-size: 12px;
   font-family: Arial;
 }
 </style>
 <script src="https://code.jquery.com/jquery-3.5.0.js"></script>
</head>
<body>

<b>Projects:</b>
<ol id="funds"></ol>

<script>
$( "#funds" ).load( "https://www.app.greaterchange.co.uk/give#47  graphic-number" ); //want to get 64
</script>

</body>
</html>

How can achieve this with javascript? Please help me.

5
  • There are no div in your html structure. And explain exactly what you want. Commented Nov 23, 2020 at 6:10
  • Its getting HTML page from that URL, did you study jQuery link. I am trying this to use Commented Nov 23, 2020 at 6:24
  • Ah, ok. I apologize. Commented Nov 23, 2020 at 6:27
  • have you a Cors error? Commented Nov 23, 2020 at 8:25
  • so i dont think you could load an url like this: 1) you have a security protocol problem with https, 2) you'll have a cors problem, the only way i see, is to load the file with the server and send result to client..... Commented Nov 23, 2020 at 9:45

1 Answer 1

1

By reading the js script inside the page web about https://www.app.greaterchange.co.uk/give#47, you could see it loads the page by sending the url https://www.app.greaterchange.co.uk/give/ajax/47 (respons to a click on picture) . i suggest you to use this url if you want to trap some values.

so you could dowload the url and search easily the datas you need..but this thing could only be done with the server and not client.

I suggest you to post a request GET or POST to the server and the server will return the values wanted.

If your server is node.js you could use cherio to download the content of the page.

If your server is C#, you could use DownloadString

and dont forget to authorize the protocol tls11 or tls12...(https)

For precision you could keep .load function, but you modify the call by removing https: for example:

.load( "/www.app.greaterchange.co.uk/give#47  graphic-number" );

the server will receive a GET request with the url in its arguments. The url will be change to give/ajax/47.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.