Last active
December 31, 2016 01:06
-
-
Save grillermo/3d27e984dee896142e8a7c79ddeb3030 to your computer and use it in GitHub Desktop.
You can't export from all your companies in facturify and you cant scrape in automated fashion due to the captcha so you have to use a browser based scraper such artoo.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
aliadas_urls = [ | |
{ | |
url: 'https://client.facturify.com/models/multiempresa.php?type=defecto&id=12', | |
data: { | |
multi: 288, // ID of the company | |
}, | |
}, | |
] | |
artoo.ajaxSpider( | |
aliadas_urls, | |
{ | |
jquerify: true, | |
throttle: 100, | |
method: 'post', | |
process: function(data){ | |
urls = [] | |
// Target with jquery the invoices you want | |
data.find("form[name=form1] td:contains(PUBLICO EN GENERAL)").parent('tr').find('a[href*=2016-12]').each(function(){ | |
url = $(this).attr('href') | |
urls.push(url) | |
}) | |
return urls; | |
} | |
}, | |
function(data) { | |
flattened_data = Array.prototype.concat.apply([], data) | |
artoo.saveJson(flattened_data, {filename: 'facturas-de-aliadas.json'}); | |
} | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Get artoo from
http://medialab.github.io/artoo/