0

I use windows.open to load a HTML page (XML file view, from a GET request) where there are plenty of div & span with same names...

I need to look for the string "inactive" :

  • If not found i load a new HTML file.

  • If found i need to look for another string "id" and copy it into a array (to read it later), then loading a new file and looping again searching for "inactive"

One of the main problems is my fields all looking like this : class name being the same, and text between 'span'

My main problem being i don't know how to look for the desired text in my new HTML page after window.open

tldr : I know how to open a GET request in a new tab, but i don't know how to interact with it

<button onclick="openURL()">Open URL</button>
<script type="text/javascript">
    function openURL() {
    var myURL = 'http://secret/'
    var myID = '1260234'
    var tab = window.open (myURL + myID, '_blank', 'width=500,height=500')
}

I barely touched Javascript before, this may explain why i suck doing this piece of code :D

EDIT : web URL result

Robin
  • 1
  • 1
  • 1
    Could you please show us how did you get data from a request? and example of the data in codes instead of pictures? – ikhvjs Jun 17 '21 at 15:15
  • @ikhvjs i can't post the direct link because there's data i need to hide. I use a direct link to get the data (looks like http://mylink/account/1234), i used to get thoses data from a Postam GET request. I'll update the original post with a screenshot of the output result of the web url – Robin Jun 22 '21 at 09:41
  • Does this help you? https://stackoverflow.com/a/41009103/14032355 – ikhvjs Jun 22 '21 at 09:46
  • You can find previous answers here on StackOverflow. Maybe this can help you: [Open window in JavaScript with HTML inserted](https://stackoverflow.com/questions/2109205/open-window-in-javascript-with-html-inserted) – Peter Krebs Jun 22 '21 at 09:59

0 Answers0