Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <body>
- Symbol
- <br>
- <input type="text" id="symbol" value="">
- <br>
- <br>
- From Date
- <br>
- <input type="datetime-local" id="from-date" value="">
- <br>
- <br>
- To Date
- <br>
- <input type="datetime-local" id="to-date" value="">
- <br>
- <br>
- <button onclick="myFunction()">Try it</button>
- <p id="demo1"></p>
- <script>
- // function request_data(){
- // var requestOptions = {
- // method: 'GET',
- // mode: 'no-cors'
- // };
- // fetch("https://tvc4.investing.com/78c640d7b00dd34b4e5961c0de0aac63/1640931544/1/1/8/history?limit=3000&query=infy&type=&exchange=&resolution=1&from=1640843702&to=1640930102", requestOptions)
- // .then((response) => {
- // return response.text();
- // })
- // .then(result => console.log(result))
- // .catch(error => console.log('error', error));
- // // fetch('',requestOptions)
- // // .then(response => response.text());
- // // return "jsons";
- // }
- function myFunction() {
- // var a = document.getElementById("symbol").value;
- // document.getElementById("demo").innerHTML = a;
- var x = document.getElementById("from-date").value;
- document.getElementById("demo1").innerHTML = tests();
- }
- function tests(){
- fetch("https://tvc4.investing.com/78c640d7b00dd34b4e5961c0de0aac63/1640931544/1/1/8/history?limit=3000&query=infy&type=&exchange=&resolution=1&from=1640843702&to=1640930102", {
- "headers": {
- "accept": "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9",
- "accept-language": "en-IN,en-US;q=0.9,en-GB;q=0.8,en;q=0.7",
- "cache-control": "max-age=0",
- "sec-ch-ua": "\" Not A;Brand\";v=\"99\", \"Chromium\";v=\"96\", \"Google Chrome\";v=\"96\"",
- "sec-ch-ua-mobile": "?0",
- "sec-ch-ua-platform": "\"Linux\"",
- "sec-fetch-dest": "document",
- "sec-fetch-mode": "navigate",
- "sec-fetch-site": "none",
- "sec-fetch-user": "?1",
- "upgrade-insecure-requests": "1"
- },
- "referrerPolicy": "strict-origin-when-cross-origin",
- "body": null,
- "method": "GET",
- "mode": "no-cors",
- "credentials": "include"
- })
- .then((response) => {
- return response.text();
- })
- .then(result => console.log(result))
- .catch(error => console.log('error', error));
- }
- function uuid(){
- var u = URL.createObjectURL(new Blob([""]))
- URL.revokeObjectURL(u);
- return u.split("/").slice(-1)[0]
- }
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment