Answer the question
In order to leave comments, you need to log in
How to get src inside iframe tag?
Hello! Help solve the problem - there is an iframe on the page:
<div class="iframe-holder">
<iframe src="https://somesite.com/models/350795b06d684d3992a5efe5b3dd3c61/embed?api_version=1.0.0&api_id=7376598513360515" width="876" height="400" id="api-frame" class="b_iframe" allowfullscreen="" mozallowfullscreen="true" webkitallowfullscreen="true" data-url="350795b06d684d3992a5efe5b3dd3c61"></iframe>
</div>
Answer the question
In order to leave comments, you need to log in
let e = document.querySelector(".iframe-holder iframe");
console.log(e.src);
console.log(e.getAttribute("src"));
If the attribute value is empty, then it is filled using JS. This is easy to check if you have a Quick Javascript Switcher for your browser. Just disable JS and look at the DOM element you are interested in.
You need to study the mechanics of the page and find where the URL you need comes from. Or you can use a headless browser.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question