r/learnpython • u/MikeDoesEverything From zero to Data Engineer: https://tinyurl.com/2p8wd6y7 • Nov 10 '20
Just completed my first job on Upwork!
Holy shit, that was a wild ride.
So, I've just completed my first job on upwork and, jesus god, was it harder than I thought. The actual job wasn't very difficult although I totally suck at programming so it took way longer than it should have. I learn an absolute ton from it and wanted to share it with all you guys as a way of paying back for all the good advice I've been given.
The job
The job was to scrape financial data from a bunch of websites which the client had already compiled. The data was structured as an excel spreadsheet with hyperlinks embedded in text.
Initial thought process
- Cycle through the spreadsheet, parse all hyperlinks into a list for later.
- As all the data is from the same website, I'm going to scrape one page and get all the relevant data, then loop over it for the rest.
- I'm going to add these values as I go along into excel through Python.
- This will be fairly easy.
What actually happened
- I spent about 30 minutes trying this in vscode, setting up a virtual environment and after running my program a few times, I realise I couldn't see shit. At this point, I got annoyed and transitioned into a Jupyter Notebook. This made seeing what I was doing a lot easier and I'd recommend any data-centric projects to be done in Juypter.
- I spent about an hour having trouble with list comprehension and loops. Turns out if you run a loop within a loop, you're going to get it running twice and I wanted to run two loops parallel to each other. I solved this by using
for x,y in zip(list1, list2): - I've always said I hated parsing text because everything seems so complex. Today, I overcame my fear using
' '.join,split(), andstrip(). This probably isn't much to a lot of people, although it all came together for me today and it's something I'm really happy with. - When it came to webscraping, I got really lazy and paid the price for it. I used list slicing on elements incorrectly and ended up having it so it worked for my sample size (first two websites in list), although when it got to the latter ones, it started to do funky stuff so I had to start all over again.
- Before that, I deleted all my code to start again because I thought I was parsing data incorrectly. Turns out it was just the unicode symbols for Euro signs :( Check it's actually wrong before rage-quitting.
- Sometimes, plans don't go the way you want. I was originally hoping to fire off a load of numbers from juypter into excel in this beautiful streamlined vision. After spending so much time parsing text from beautifulsoup, I decided to give up on that dream for today and, instead, think outside the box. I ended up printing data to a text file, importing it via excel, cleaning it in excel (EDIT: I say "clean", it was deleting some punctuation marks and unwanted letters from the numbers), and then copy and pasting it. I think it's also only fair for me to mention this took about 40 minutes - I spent so long printing formatted output in Jupyter and really enjoying it that I forgot about the task. I spent a while getting the data to save horizontally with the right delimiter so I could copy and paste it into the clients spreadsheet.
- There's a lot of stop-start, especially as a non-professional, self taught person which feels fairly natural. I think if you know what you want to do, you can Google through it with some persistence but if you can't say how you'd approach the problem it's infinitely harder (like when I wanted to make my streamline dream) so you might have to just give up on a fancy idea and stick to what you know sometimes.
Hope you enjoyed reading!
EDIT: Thank you for all the awards! Really kind of you.
66
u/OilofOregano Nov 11 '20
Fair warning, this is kind of how coding is. No matter how skilled you get in programming you'll spend the majority of time debugging the most trivial "gotcha"s you can imagine.
114
u/socal_nerdtastic Nov 11 '20
Nice. What did you end up earning per hour?
30
u/Robi5 Nov 11 '20
That sounds awesome man!
If you don’t mind me asking, how was it actually getting the job on Upwork in the first place?
45
u/ClydeHays Nov 11 '20
We’re you this honest with your client. If so I’ll hire you
21
u/[deleted] Nov 11 '20
When you are cleaning the data in excel have thought about using the pandas library (https://pandas.pydata.org/)? Pandas combined with Jupyter notebooks is very good for that. Lots of pandas tutorials on the Web and YouTube.
23
u/cybersection Nov 11 '20
Sorry to be blunt, but how did you get this job? Don’t you need relevant experience to even make it through the filters when creating an account in upwork? How did you advertise yourself? Do you have other experience you used?
5
u/chinuckb Nov 11 '20
Congratulations Brother. My Upwork profile was never accepted🤣🤣. I have tried 3 times.
3
u/Nephty23 Nov 11 '20
that's insane ! I'd like to be able to solve such problems
4
u/kielerrr Nov 11 '20
If this took only 40 minutes for the entire thing, that's not a long time at all.
2
u/BadgersAreNice Nov 11 '20
How long ago did you start coding? I started learning today and I'm interested in the time it'll take me to earn some money.
51
u/GrowHI Nov 11 '20
Honestly the way you described your problems leads me to believe you're a competent programmer. With time and effort you will do great man. Keep up the good work.
2
u/yasamoka Nov 11 '20
Good job. Scrapy would make your life a whole lot easier for these kinds of tasks, so it would be a good idea to get into that and get the hangs of dealing with the framework's philosophy.
1
u/valsterdam Nov 11 '20
Great job! This is just the begining, keep hustling :)
1
u/vyper01 Nov 11 '20
Thanks for sharing!
1
u/leogodin217 Nov 11 '20
Did you charge for all the time you worked or did you stop the tracker when you were figuring out how to do things?
1
u/[deleted] Nov 11 '20
Without giving away too much confidential details, what was the business need behind the financial data?
1
u/monkeybizzzz Nov 11 '20
As a newbie, this was very inspirational! Thanks for posting this and keep up the great job!
1
u/t3rrO10k Nov 11 '20
Nice to see someone writing pseudo-code. In fact, I thought pseudo-code was an academic only exercise (be I never wrote or saw any during my time as a programmer). Good job!
1
u/benandwillsdad Nov 11 '20
Don't know if you were looking to know this, but you can work in juypter notebooks right in vscode. Give a file a .ipynb extension.
1
u/yerba-matee Nov 11 '20
Yes man!
I'm not quite there yet to start looking for work I don't think, but mad excited for you dude!
How long did you have to work all of this out may I ask, as in how long did the client give you?
4
u/TacoSmutKing Nov 11 '20
Patience is a bitter plant with a sweet fruit
2
u/cybervegan Nov 11 '20
Cool. That's how it goes. It gets easier, but there's always things you have to puzzle out and experiment with, and things seldom work out exactly as you had invisaged at first.
2
u/wtfpmf Nov 11 '20
Great post, man
2
u/hethram Nov 11 '20
I tried for few days to get a gig on upwork but in vain. I guess getting that first job as a freelancer is tough enough.
2
u/FormalWolf5 Nov 11 '20
I spent like 2 or 3 hours yesterday trying to install spacy and use it in Jupyter and never could
1
u/stealthagents Jun 26 '25
Oh man, welcome to the club of coding chaos. Scraping's a mix of scripting and detective work—every site is like a new puzzle with its own quirks. But hey, at least now you have some serious Python and debugging skills under your belt.
1
u/MoodyMcFly Nov 11 '20
Next time go for Jupiter-Lab. Easier on the eyes. Cheers.
1
u/[deleted] Nov 11 '20
any sort of communication issues with your client?
1
u/vmgustavo Nov 11 '20
That's awesome, congrats. I tried to get jobs in Upwork, used all of my connects and didn't get any unfortunatelly.
1
u/dereck255 Nov 11 '20
See, this is my struggle. I love the formatting and autocomplete I have in pycharm but love the visualizations in jupyter. How can I get the best of both worlds??
1
u/Cayde-6699 Nov 12 '20
Can I see your code on how u exported the data to excel I’m trying to do this as practice but when I try to it only shows the last item
1
u/[deleted] Nov 11 '20
it was a good read man, makes me feel happy that there are other people out there who kinda struggle the same way I do but I've never gotten a job tho sed.
0
u/[deleted] Nov 11 '20
[deleted] — view deleted comment
0
u/[deleted] Nov 11 '20
[deleted] — view deleted comment
0
u/[deleted] Nov 11 '20
[deleted] — view deleted comment
1
u/[deleted] Nov 11 '20
[removed] — view removed comment