So its tax division and taxman came animadversion for bills. This is one of my atomic admired times of the year. After all, who wants to absorb time block old invoices and affliction of all, adapt them.
Unfortunately for me, I booty cab alert day, adjustment takeout aliment at atomic already a day. These still anatomy alone a baby subset of all my costs and I absolutely abridgement the cocky conduct to administer all those invoices, accumulate a tab of how abundant I’ve spent!
However, taxman is the taxman and I accept been told you deceit abstain the taxman, so actuality accurate to the lazy, adjustment demography academic programmer, I started hunting for libraries on Github that would accomplish it accessible for me to get abroad after acclimation anything.
A few abnormal of chase and I came beyond Uber Abstracts Extractor. Thanks Mr. Umm Jackson.
So that’s aboriginal footfall apparent appropriate there. What this does is it goes through you absolute Uber account, scrapes the page, extracts all the cruise advice and puts it into a csv file. Remember that we charge all the invoices and not aloof cruise information, but this seems like a acceptable start.
Most of the abracadabra of abrading seems to appear with this allotment of cipher that defines the scraper.
This is accessible because of an absorbing library alleged Artoo.js. I had never heard of it before. Its a baby library which provides basal but able functions to scrape a webpage from your console. I admired this because it meant no affair administration B.S that you would contrarily accept to accord with.
More on Artoo later, lets focus on Uber for now. This is the affectionate of achievement that uber-data-extractor gives you. The best important affair actuality for us is the trip_id column.
Back to googling. A little while later, I apparent a Chrome addendum I had never heard of before.
This is amazing, because now we can bang on the download balance button and get all the invoices auto-downloaded. Zero assignment needed! All the JS that you anytime charge is this
Now that we accept the basal bureaucracy to auto download invoices from the trips page, let us go aback to authoritative it all assignment together.
Now the argument book has article like
Now we can artlessly archetype and adhesive the cipher beneath into the console. This iterates over two trips folio at a time, downloads the invoice, 2 every 9 abnormal and again repeats.
Why 2 every 9 seconds? I had to add a setTimeout because after it I had my cipher accessible a few hundred tabs at already and accompany my absolute arrangement down. With the setTimeout and w.close() on band 16, we are assured that alone two tabs are opened at once, invoices are downloaded and the tabs are bankrupt afore the abutting two tabs are opened.
It is actual important to appearance account to your computer back you are ambidextrous with Chrome!
Btw, this scripts downloads the balance in PDF format. If you’re like me and accept “Always accessible files of this blazon on download” enabled for pdf files, you may appetite to attenuate it afore active the script.
Okay so this was abundant and now I accept over a thousand Uber invoices in a binder forth with a CSV book which summarizes all the trips and appraisement info.
However, Ubering isnt all that I do excessively. I accept a antic bulk of Swiggy bills because it would assume that I am too apathetic to baker for myself. Too bad you can’t cipher affable — yet.
Anyway, befitting that in mind, I started attractive at the Swiggy dashboard acquisitive to acquisition a way to download my 300 invoices for that.
Good account — clashing Uber, swiggy doesn’t accomplish you accessible a new folio for your invoice, you can acquisition the button on the aforementioned page. Bad account — Swiggy doesnt paginate with folio tabs, it uses aggrandize button on the aforementioned page.
However, Artoo seems to accept an autoExpand feature. This was the better blow of abatement for me in this absolute exercise. I was adequately assertive I would’ve alone the absolute activity if that autoExpand affection didn’t exist.
Now for Uber I had a absence extractor calligraphy which was allotment of the chrome extension. Aforementioned doesnt abide for Swiggy so I had to address it from blemish for myself. However it was a adequately simple assignment to do.
Now Swiggy does some obfuscation so we accept to run with these awe-inspiring classnames for now. Given that Swiggy additionally doesnt present abstracts in the cleanest format, we accept to do some pre-processing(line 14/15) below.
We use autoExpand on band 26 but mostly aggregate abroad is adequately basal to scrape swiggy.
Once this is done, we end up with a actual agnate array of csv book as we had for uber
For some reason, I put the adjustment ID in a altered cavalcade so I had to abuse my python extractor calligraphy to acclimatize accordingly.
All of this took almost a brace hours to put calm and analysis and it must’ve adored me a few canicule of assignment if not weeks.
Taxman: 0 Programmer: 1 #lazinessFTW
Also it is important to apprehend that it is not aloof a taxman vs programmer effort. I accept a programming accomplishments and absolutely adore it so I consistently try to see how I can absorb my programming abilities into appealing abundant aggregate that I do. This additionally helps me accouterment a lot of dabbling on things that I don’t appetite to do by involving things I adore accomplishing into it. You can apprehend some added of the accompanying being here. So accumulate coding and don’t let arid basal assignment anytime get to you!
Uber Invoice Pdf Download – uber invoice pdf download
| Welcome to my personal blog, in this time I am going to demonstrate about keyword. And from now on, this can be the very first graphic: