0

I want to write a spider for scrapying http://bbs.pinggu.org/. But signing in this web should select security question yourself and answer it. part of the web codes is:

<p class="">
    <img src="/static/images/yonghu.png" class="img1">
    <img src="/static/images/yonghu-btn.png" class="img2">
    <input type="text" id="username" name="username" placeholder="请输入用户名或者手机号"/>
    <img src="/static/images/qingchu.png" class="fl-r">
</p>
              

Here need to input username.

<p class="">
    <img src="/static/images/password.png" class="img1">
    <img src="/static/images/password-btn.png" class="img2">
    <input type="password" id="password" name="password" placeholder="请输入密码"/>
</p>

Here need to input password.

<p id="select_bady">
    <img src="/static/images/anquan.png" class="img1">
    <img src="/static/images/anquan-btn.png" class="img2">
 <input type="hidden" id="questionid" name="questionid" value="0">
    <!--<select id="questionid" name="questionid" style="right:200rem;">
        <option value="0" >安全提问(未设置请忽略)</option>
        <option value="1">母亲的名字</option>
        <option value="2" >爷爷的名字</option>
        <option value="3">父亲出生的城市</option>
        <option value="4">你其中一位老师的名字</option>
        <option value="5">你个人计算机的型号</option>
        <option value="6">你最喜欢的餐馆名称</option>
        <option value="7">驾驶执照最后四位数字</option>
    </select>-->
                    
                    
    <img src="/static/images/sanjiao_03.png" class="fl-sj">
</p>

<div class="select">
    <div class="input_in">
        <input type="text" value="安全提问(未设置请忽略)" />
    </div>
    <div class="city hide">
        <ul>
            <li v="0">安全提问(未设置请忽略)</li>
            <li v="1">母亲的名字</li>
            <li v="2">爷爷的名字</li>
            <li v="3">父亲出生的城市</li>
            <li v="4">你其中一位老师的名字</li>
            <li v="5">你个人计算机的型号</li>
            <li v="6">你最喜欢的餐馆名称</li>
            <li v="7">驾驶执照最后四位数字</li>
        </ul>
    </div>
</div>

Here need to select the questionid from 0 to 7.

<p class="answer-k answer-bottom">
    <img src="/static/images/mibao-tu.png" class="img1">
    <img src="/static/images/mibao-tu-btn.png" class="img2">
    <input type="text" name="answer" id="answer" placeholder="请输入问题答案">
</p>

Here need to input your answer of the selected questionid.

How to semulate to login in for webs like this.

Kayvan Mazaheri
  • 2,447
  • 25
  • 40
Eric
  • 153
  • 2
  • 6
  • Take a look at this https://stackoverflow.com/questions/11892729/how-to-log-in-to-a-website-using-pythons-requests-module/11892838#11892838 – Richard Rublev Jan 01 '18 at 06:33
  • I have learned that question and answer,but whith i want to know is how to handle the questionid ? – Eric Jan 01 '18 at 07:06

0 Answers0