下面的html是我在登陆之后得到的body部分,可以看到主要有两部分,一个是导航栏(index_nav,其实现也是利用JS,具体代码在head中),另一部分是内容(content),在使用selenium和phantomjs输入完用户名和密码点击登陆后确实可以得到导航栏的详细源代码,但是由于内容部分的src在iframe中,我发现phantomjs是无法得到其源代码的,因此我该怎么办?还有内容部分的src在每次登陆后我发现其值是变化的,尤其是最后的ticket参数,当然这个利用正则表达式我能得到。
<body marginheight="0" marginwidth="0" topmargin="0" leftmargin="0" text="#000000" bgcolor="#FFFFFF" style="display:none">
<div class="index_nav" id="global_nav"></div>
<div id="wrapper">
<div id="content">
<table class="frame_tab" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" class="column">
<div id="23-2604_table" class="tab_02_no_border clearfix">
<iframe width="100%" frameborder="no" bgcolor="#e8e8e9" marginheight="1" marginwidth="1" src="http://zhjw.cic.xxxxx.edu.cn/j_acegi_login.do?url=/zhjw.do&m=jxmh_show&flag=yjsjwjxxx&version=1&ticket=pm8EKA0Hpw2n01RFQZ62ST8GKW" id="23-2604_iframe">
dummyText
</iframe>
<script type="text/javascript">
var height= "1500";
var id_iframe = "23-2604" + '_iframe';
document.getElementById(id_iframe).height = height;
</script>
</div>
</td>
</tr>
</table>
</div>
<div style="text-align:center; min-height:300px; overflow:hidden; margin-top:50px;">
<span>如果您对。</span>
<br>
</div>
</div>
</body>