Skip to content

Instantly share code, notes, and snippets.

View yencarnacion's full-sized avatar

Yamir Encarnacion yencarnacion

View GitHub Profile
@yencarnacion
yencarnacion / plate-snitch.js
Created September 1, 2017 00:10 — forked from taitems/plate-snitch.js
(Extract) Check the status of a vehicle registration and scrape results.
// Open form and submit enquire for `rego`
function getInfo(rego) {
horseman
.userAgent('Mozilla/5.0 (Windows NT 6.1; WOW64; rv:27.0) Gecko/20100101 Firefox/27.0')
.open(url)
.type('#registration-number-ctrl input[type=text]', rego)
.click('.btn-holder input')
.waitForSelector('.ctrl-holder.ctrl-readonly')
.html()
.then(function(body) {
@yencarnacion
yencarnacion / write_csv_py
Created December 2, 2020 02:03
Examples of writing a csv file in python
a_list = ['uno, dos', 'tres, cuatro']
for x in a_list:
out = "%s\n" % (x)
# puede que en Windows tengas que hacer lo que sigue
# out = "%s\r\n" % (x)
with open("outfile1.csv","a") as fo:
fo.write(out)