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

4
  • 1
    Could you please show us how did you get data from a request? and example of the data in codes instead of pictures? Commented Jun 17, 2021 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 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 Commented Jun 22, 2021 at 9:41
  • Does this help you? stackoverflow.com/a/41009103/14032355 Commented Jun 22, 2021 at 9:46
  • You can find previous answers here on StackOverflow. Maybe this can help you: Open window in JavaScript with HTML inserted Commented Jun 22, 2021 at 9:59

0

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.