使用R完成Web表单

时间:2018-06-06 23:09:15

标签: r forms authentication web-scraping

我正在尝试使用R从网站上抓取一些数据,但每隔一段时间它就会要求我输入密码。我怎样才能在表格中填写R?

表单的html代码如下所示:

<form action="/en/login" method="post">
          <input type="hidden" name="_target_path" value="http://website.com/" />

            <div style="margin-top:10px;">
      <input type="text" id="username" name="_username" value="" class="inputLoginBox" placeholder="your username" tabindex="1"/></td>
    </div>
    <div style="margin-top:10px;">
      <input type="password" id="password" name="_password"  class="inputLoginBox" placeholder="your password"  tabindex="2"/></td>
    </div>
    <div style="margin-top:10px;">
      <input type="checkbox" id="remember_me" name="_remember_me" class="inputCheckbox" tabindex="3"/>
      <label for="remember_me">remember me</label>
      &nbsp;<a href='http://website.com/forum/ucp.php?mode=sendpassword' border="0" rel="nofollow" class="alt">forgot password?</a>
    </div>
    <div style="margin-top:10px;">
      <button type="submit" class="submitButton"  name="login[go]" tabindex="4" style="font-size:1.3em;">login</button>
      <br><br>
    </div>

</form>

0 个答案:

没有答案