采用可见即可爬的方法
- 模拟登录
- 抓取说说内容
自己的个人说说网址:
https://user.qzone.qq.com/你的qq号/311
一、打开登录界面
切换iframe
1.由于登录按钮是在iframe上,所以第一步需要把定位器切换到iframe上
2.用switch_to_frame方法切换,此处有id属性,可以直接用id定位切换
<iframe id="login_frame" name="login_frame" height="100%" scrolling="no" width="100%"
iframe是HTML标签,iframe 元素会创建包含另外一个文档的内联框架(即行内框架)。
定位输入框
分别为账户,密码,登录按钮:
<div class="login_form"><form id="loginform" autocomplete="off" name="loginform" action="" method="post" target="0" style="margin:0px;"><div class="uinArea" id="uinArea"><label class="input_tips_focus" id="uin_tips" for="u" data-onlyqq="QQ号码" style="display: none;">支持QQ号/邮箱/手机号登录</label><div class="inputOuter"><input type="text" class="inputstyle" id="u" name="u" value="" tabindex="1"> <a class="uin_del" id="uin_del" href="javascript:void(0);" style=