Hi everyone,
I am new to here, I am currently working on my own project, I want to automatically request a website eg. www.example.com, then there are some specific buttons to click and to fill with the text I want (like a auto post) in Javascript.
currently I have tried some code to request the url, it comes up with CORS problem.
var theSite = new XMLHttpRequest();
var theUrl = "www.example.com";
function loadPage(){
theSite.addEventListener("readystatechange", autopost, false);
theSite.open('GET', theUrl, true);
theSite.send();
}
Question:
- How to solve the CORS problem?
- Does "theSite" contains the entire DOM from the url?
- if Yes, then can use getElementByID() from "theSite"?
Thanks for the help.