-1

i tried to load the page using XMLHttpRequest() but i got

blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource

so i tried to load the page using something else so i used

object type="text/html" data="http://page/"></object> 

it loaded the page in a small box . so i tried to define the page code to a constant so i be able to find a value from it's code using

let str = document.querySelector("body") 

but it selected my page body not the page loaded using object . i tried the querySelector because

document.documentElement.innerHTML 

have the same problem. if there a way to inspect elements to the correct page it would solve this . the page and console before inspecting the wanted area manually

enter image description here

the page and console after inspecting the wanted area manually

enter image description here

note: i can't edit the requested page

4
  • I don't really get what you are trying to do but regarding the CORS issue you can check stackoverflow.com/questions/20035101/… Commented Jun 9, 2019 at 16:18
  • "what you are trying to do" i am trying to get the value that's used to login to make an auto login script .. the link doesn't help a lot cause i am not using php or node ! Commented Jun 9, 2019 at 17:09
  • i just want to get it working using this object method ! Commented Jun 9, 2019 at 17:19
  • @Yaki for more info about what i am trying to do . link Commented Jun 9, 2019 at 17:26

1 Answer 1

0

You can't because objects ( Iframses ) have the cross domain policy too

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

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.