I'm completely new to selenium and javascript. The webpage that I'm working on uses javascript to do certain authentication and construct the url for a frame.
The code looks something like:
<iframe id="main_contents"></iframe>
<script type="text/javascript">
var baseUrl = 'http://xxxxxxxxx.com/';
function init() {
gadgets.io.makeRequest(baseUrl+"auth/", function(obj) {
var iframe = document.getElementById("main_contents");
if (obj.data.status == 'OK') {
iframe.src = baseUrl+"?xx="+obj.data.xx;
...
}
...
}, params);
}
I have tried to directly locate the frame with find_element_by_tag_name but of course its src is empty. I have no idea how to switch to this frame. Could anyone suggest? Thank you very much!!