Completing a web form using R - r

I am trying to scrape some data from a website using R, but every once in a while it asks for my password. How can I have R fill in the form?
The html code for the form looks like this:
<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>
forgot password?
</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>

Related

Bootstrap Column CSS

Here is my Angular2 Form
<form [formGroup]="myForm" autocomplete="off" novalidate> <div
class="row"> <div class="form-group col-md-4" [ngClass]="{ 'error' :
myForm.controls.firstname.invalid &&
myForm.controls.firstname.touched}">
<label for="firstname">Please tell us your name</label>
<control-messages [control]="myForm.controls.firstname"></control-messages>
<input name="firstname" formControlName="firstname" type="text"
class="form-control" placeholder="First Name *" /> </div> <div
class="form-group col-md-4" >
<label for="middlename"> </label>
<control-messages [control]="myForm.controls.middlename"></control-messages>
<input name="middlename" id="middlename" type="text" class="form-control"
placeholder="Middle Name" formControlName="middlename"/> </div>
<div class="form-group col-md-4" [ngClass]="{ 'error' :
myForm.controls.lastname.invalid && myForm.controls.lastname.touched
}">
<label for="lastname"> </label>
<control-messages [control]="myForm.controls.lastname"></control-messages>
<input name="lastname" formControlName="lastname" type="text" class="form-
control" placeholder="Last Name *"/> </div> </div>
</form>
enter image description here
How do I line up all the columns correctly? Please help.
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.6/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<form [formGroup]="myForm" autocomplete="off" novalidate>
<div class="row">
<div class="form-group col-md-4" [ngClass]="{ 'error' :
myForm.controls.firstname.invalid &&
myForm.controls.firstname.touched}">
<label for="firstname">Please tell us your name</label>
<control-messages [control]="myForm.controls.firstname"></control-messages>
<input name="firstname" formControlName="firstname" type="text" class="form-control" placeholder="First Name *" />
</div>
<div class="form-group col-md-4">
<label for="middlename"> </label>
<control-messages [control]="myForm.controls.middlename"></control-messages>
<input name="middlename" id="middlename" type="text" class="form-control" placeholder="Middle Name" formControlName="middlename" />
</div>
<div class="form-group col-md-4" [ngClass]="{ 'error' :
myForm.controls.lastname.invalid && myForm.controls.lastname.touched
}">
<label for="lastname"> </label>
<control-messages [control]="myForm.controls.lastname"></control-messages>
<input name="lastname" formControlName="lastname" type="text" class="form-control" placeholder="Last Name *" />
</div>
</div>
</form>
You had some line breaks in between form-control for the last name input field, try like this:
<form [formGroup]="myForm" autocomplete="off" novalidate>
<div class="row">
<div class="form-group col-md-4" [ngClass]="{ 'error' :
myForm.controls.firstname.invalid &&
myForm.controls.firstname.touched}">
<label for="firstname">Please tell us your name</label>
<control-messages [control]="myForm.controls.firstname"></control-messages>
<input name="firstname" formControlName="firstname" type="text"
class="form-control" placeholder="First Name *" />
</div>
<div class="form-group col-md-4" >
<label for="middlename"> </label>
<control-messages [control]="myForm.controls.middlename"></control-messages>
<input name="middlename" id="middlename" type="text" class="form-control"
placeholder="Middle Name" formControlName="middlename"/>
</div>
<div class="form-group col-md-4" [ngClass]="{ 'error' :
myForm.controls.lastname.invalid && myForm.controls.lastname.touched
}">
<label for="lastname"> </label>
<control-messages [control]="myForm.controls.lastname"></control-messages>
<input name="lastname" formControlName="lastname" type="text" class="form-control" placeholder="Last Name *"/>
</div>
</div>
</form>

bootstrap - add label to span

I have the following markup
<form role="form">
<div class="input-group">
<label for="accountSpan">Account name</label>
<span class="input-group-addon" id="accountSpan">something</span>
<input type="text" class="form-control" placeholder="account name" aria-describedby="basic-addon1" id="accountInput" >
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<input type="password" class="form-control" id="exampleInputPassword1" />
</div>
</form>
which results in
How can I have it aligned like the password?
Try like this: Demo
If you use form-group along with input-group like you did for password, you can get your expected output.
<div class="form-group">
<label for="accountSpan">Account name</label>
<div class="input-group">
<span class="input-group-addon" id="accountSpan">something</span>
<input type="text" class="form-control" placeholder="account name" aria-describedby="basic-addon1" id="accountInput">
</div>
</div>
#import url('//netdna.bootstrapcdn.com/bootstrap/3.0.0/css/bootstrap-theme.min.css');
<form role="form">
<div class="input-group">
<label for="accountSpan">Account name</label>
<span class="input-group-addon" id="accountSpan">something</span>
<input type="text" class="form-control" placeholder="account name"
aria-describedby="basic-addon1" id="accountInput" >
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<input type="password" class="form-control" id="exampleInputPassword1" />
</div>
Here your answer jsFiddle:
<form role="form">
<div class="form-group">
<label for="accountSpan">Account name</label>
<div class="input-group">
<span class="input-group-addon" id="accountSpan">something</span>
<input type="text" class="form-control" placeholder="account name" aria-describedby="basic-addon1" id="accountInput" >
</div>
</div>
<div class="form-group">
<label for="exampleInputPassword1">Password</label>
<input type="password" class="form-control" id="exampleInputPassword1" />
</div>
</form>

How can I debug twitter bootstrap v4-alpha grid? col-sm-offset-* not working

I've changed something, somewhere and now col-sm-offset-*s aren't working at all. For example, if I wanted to split the screen in half, and display content only on the right hand side, I would usually use:
<div class="container">
<div class="row">
<div class="col-sm-6 col-sm-offset-6">
This content isn't on the right hand side, it's on the left as if the col-sm-offset-6 isn't even there.
</div>
</div>
</div>
How can I check what's wrong?
I'm using NPM and Laravel Elixir (gulp) to minify (make production ready) the files and short of me copying the entire CSS file here, I don't know what else to do. Is there anything obvious? Has anyone come across this before?
Update
<div class="container">
<div class="row">
<div class="col-sm-6 col-sm-offset-6">
<div class="row">
<form role="form" method="POST" action="/register">
<input type="hidden" name="_token" value="abcdefghij">
<div class="col-xs-12">
<fieldset class="form-group">
<label for="username" class="form-control-label">Username</label>
<input name="username" type="text" class="form-control " id="username" placeholder="Enter a username" value="j">
</fieldset>
</div>
<div class="col-sm-6">
<fieldset class="form-group">
<label for="first_name" class="form-control-label">First Name</label>
<input name="first_name" type="text" class="form-control " id="first_name" placeholder="Enter your first name" value="John">
</fieldset>
</div>
<div class="col-sm-6">
<fieldset class="form-group">
<label for="last_name" class="form-control-label">Last Name</label>
<input name="last_name" type="text" class="form-control " id="last_name" placeholder="Enter your last name" value="Appleseed">
</fieldset>
</div>
<div class="col-sm-6">
<fieldset class="form-group">
<label for="email" class="form-control-label">Email Address</label>
<input name="email" type="email" class="form-control " id="email" placeholder="Enter your email address" value="j#a.com">
</fieldset>
</div>
<div class="col-sm-6">
<fieldset class="form-group">
<label for="password" class="form-control-label">Password</label>
<input name="password" type="password" class="form-control " id="password" placeholder="Enter a password" value="password">
</fieldset>
</div>
<div class="col-sm-6">
<fieldset class="form-group">
<label for="password_confirmation" class="form-control-label">Confirm Password</label>
<input name="password_confirmation" type="password" class="form-control " id="password_confirmation" placeholder="Please confirm your password" value="password">
</fieldset>
</div>
<div class="col-sm-6">
<div class="form-group">
<button type="submit" class="btn btn-primary pull-right">Register</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
Web Inspector
CSS Computed Properties
Update 2
I've submitted an issue on GitHub as this may have been intentional.
The current correct offset class for Bootstrap v4 Alpha:
class="col-md-6 offset-md-3"
GitHub have officially changed their col-bp-offset-* names although the documentation is currently outdated.
See issues: #19099, #19368, #19267, and my own #19562.
I'll close the question and update my GitHub issue too.

Changing framework from pure.css to bootstrap, without changing markup

Currently I have a site styled up in Pure. How could I change a pure form to a bootstrap form without changing markup? My pure form is this:
<form class="pure-form pure-form-stacked">
<div class="pure-control-group">
<label for="first-name">First name</label>
<input class="pure-input-1-2" type="text" id="first-name" placeholder="First name">
</div>
<div class="pure-control-group">
<label>Last name</label>
<input class="pure-input-1-2" type="text" placeholder="Last name">
</div>
<div class="pure-control-group">
<label>Middle names</label>
<input class="pure-input-1-2" type="text" placeholder="Middle names">
</div>
<div class="pure-control-group">
<label>Gender</label>
<select>
<option>Male</option>
<option>Female</option>
<option>Other</option>
</select>
</div>
<button>Save</button>
</form>
You can use Bootstrap's predefined classes for labels and form controls.
Here's an example:
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" />
<form role="form">
<div class="form-group">
<label for="first-name">First Name:</label>
<input type="first-name" class="form-control" id="first-name" placeholder="First Name">
</div>
<div class="form-group">
<label for="last-name">Last Name</label>
<input type="last-name" class="form-control" id="last-name" placeholder="Last Name">
</div>
<div class="form-group">
<label for="middle-names">Middle Name</label>
<input type="middle-names" class="form-control" id="middle-name" placeholder="Middle names">
</div>
<div class="form-group">
<label for="sel1">Gender</label>
<select class="form-control" id="gender">
<option>Male</option>
<option>Female</option>
<option>Other</option>
</select>
</div>
<button type="submit" class="btn btn-default">Submit</button>
</form
Standard rules for form layouts:
Always use <form role="form">
Wrap labels and form controls in <div class="form-group">
Add class .form-control to all textual <input>, <textarea>, and <select> elements

Set a Virtual Page View with Universal GA

This is my HTML from. and i'm trying to set a Virtual Page View when submitting the form but i just can't make it work.
Pls advice
<form id="frmContact" action="post.php" method="post">
<div class="form-right-pnl">
<input type="text" class="required name" size="40" placeholder="×©× ×ž×œ×:" name="full_name">
<input type="text" class="required phone" size="40" placeholder="טלפון:" name="phone">
<input type="text" class="required email" size="40" placeholder='דו×"ל:' name="email">
<span>מ×שר קבלת ×—×•×ž×¨×™× ×¤×¨×¡×•×ž×™×™×</span>
<input type="checkbox" class="radio_btn" name="selling_a_property" checked value="Yes"/>
</div>
<div class="form-left-pnl" id='basic-modal'>
<input class="ddl_list" type="submit" value="" onClick=”_gaq.push([‘_trackEvent’, ‘Forms’, ‘Submit’]);” />
</div>
<div class="clear"></div>
</form>
Change this line
<input class="ddl_list" type="submit" value="" onClick=”_gaq.push([‘_trackEvent’, ‘Forms’, ‘Submit’]);” />
for
<input class="ddl_list" type="submit" value="" onClick=”_gaq.push(['_trackPageview', '/virtual-page-view-on-click-submit-button']);” />

Resources