2
</head>
<body>
    <h1>Welcome to My Homepage</h1>
    <div id="details_readonly">
        To see Carnaval history:  <a
        href="http://carnaval.amazon.com/v1/viewHistory.do?type=monitor&name=PyOP.EU.MPQS.Prod.OneBox.RequestError">http://carnaval.amazon.com/v1/viewHistory.do?type=monitor&amp;name=PyOP.EU.MPQS...</a>

        To see Carnaval snapshot: <a
        href="http://carnaval.amazon.com/v1/viewSnapshot.do?timestamp=2018-05-17+22%3A40%3A34.475&amp;name=PyOP.EU.MPQS.Prod.OneBox.RequestError">http://carnaval.amazon.com/v1/viewSnapshot.do?timestamp=2018-05-17+22%3A40%...</a>
    </div>
</body>
</html>

I can access the href of this page using

var oLink = document.getElementById('details_readonly').getElementsByTagName("a");
var i, len = oLink.length;

for( i = 0; i < len; i++ ) {
    var li= oLink[i].getAttribute('href');              
    if(oLink[i].innerHTML.indexOf("viewSnapshot.do") != -1 ) {
        //...get document of the link
   }
}

However, now I want to access the document(and its hrefs subsequently) of the link identified at "//...get document of the link"?

Is it possible using javascript, if yes how?

LionKing_MB
  • 31
  • 1
  • 4

0 Answers0