Associate
Hey all,
I'm trying to scrape the activity feed from the Barclay's Cycle Hire website but have come to a dead end because the page with the login form seems to set a hidden POST variable, so I'll need to retrieve and cache that in cURL, but not sure how
The login form is here:
https://web.barclayscyclehire.tfl.gov.uk/
It seems to submit three POST variables:
login[Username]
login[Password]
login[_csrf_token]
The csrf_token one seems completely random each time you load the page... so not sure how to do this in cURL
edit:
Basic form code:
edit2!: I tried using pret_match to grab the value but I think it gets a different value when cURL connects to the site
I'm trying to scrape the activity feed from the Barclay's Cycle Hire website but have come to a dead end because the page with the login form seems to set a hidden POST variable, so I'll need to retrieve and cache that in cURL, but not sure how
The login form is here:
https://web.barclayscyclehire.tfl.gov.uk/
It seems to submit three POST variables:
login[Username]
login[Password]
login[_csrf_token]
The csrf_token one seems completely random each time you load the page... so not sure how to do this in cURL
edit:
Basic form code:
Code:
<form action="/" method="post">
<fieldset>
<label for="login_Email">Email address</label> <input autocomplete="off" size="40" maxlength="254" type="text" name="login[Email]" id="login_Email" />
<label for="login_Password">Password</label> <input autocomplete="off" size="20" maxlength="16" type="password" name="login[Password]" id="login_Password" />
<!-- SUBMIT BUTTON -->
<input type="submit" value="Sign in" class="button-default-1" />
<!-- TOKEN -->
<input type="hidden" name="login[_csrf_token]" value="a213399200aa6fb6d90e3de70835d23d" id="login__csrf_token" /> </fieldset>
</form>
edit2!: I tried using pret_match to grab the value but I think it gets a different value when cURL connects to the site
Last edited: