r/learnpython • • Sep 17 '20

Automate your daily tasks with Python

Hey.

I recently saw someone advertise that they'd be willing to help some lucky folks with automating their daily tasks.

With 8 years experience under my belt and having worked on numerous projects, I want to give back and help others. After all, that's what makes the world go round.

Please drop below some tasks that you carry out on the daily that could be automated - and, I'll help you.

Edit: there’s a whole bunch of stuff to get through, I’m not ignoring you guys. I’ll get round to you all. I’m working on some stuff now for some people, and even being paid to do it too :D thank you so much for your positive response guys, I’m so glad I can be helping some of you!!

640 Upvotes

285 comments sorted by

View all comments

Show parent comments

153

u/hustlingpigeon Sep 18 '20

I can for sure do this. Send me a DM, and I’ll send you over my email and we’ll go from there.

48

u/kvndakin Sep 18 '20

I'm interested in just learning how to do something like this, could I possibly see some of your code once it's done?

15

u/LaLambo Sep 18 '20

Same

8

u/SukottoHyu Sep 18 '20

You can browse tons of open source code on github.

15

u/[deleted] Sep 18 '20 edited Sep 18 '20

[removed] — view removed comment

3

u/[deleted] Sep 18 '20

So I’m not sure what he’s going to do with the excel spreadsheet but I would probably just upload it to google sheets. Using selenium with google sheets is a nightmare. Luckily someone made the package PyDrive which is super easy to work with Google Drive’s API

4

u/turner_prize Sep 18 '20

It would probably be easier to just turn the excel sheet into a dataframe with pandas and iterate through the rows

→ More replies (2)
→ More replies (1)
→ More replies (1)

5

u/alienpsp Sep 18 '20

same here as well as learning best practice

4

u/Silverdog777 Sep 18 '20

Same, also to learn best practice. Thank you

3

u/[deleted] Sep 18 '20

Same

3

u/elixiri182 Sep 18 '20

Same, me as it guy always try to assist functional to ease and simplify their job, the scenario mention might be useful for my functional team. Hence, i would like to know how u code it, so i can learn and modify to help out other people.

2

u/[deleted] Sep 18 '20

Same here

→ More replies (6)

46

u/[deleted] Sep 18 '20

You are such a nice person. A small bit of my faith in humanity has been restored ;)

6

u/esly4ever Sep 18 '20

Great stuff. Keep it going.

6

u/[deleted] Sep 18 '20

I would be interested in seeing the code.

I am learning Python by Automate the Boring Stuff with Python. I think that this task can be automated by using request or selenium for the page text and then using regex for getting the names. Afterwards, we can search using Selenium, I guess, and use a print to pdf function.

I wanna see if you will opt for this pathway or if there is a better alternative.

4

u/LeadingJudgment2 Sep 18 '20

I'm just dipping my toes into automation. I already did how to automate the boring stuff but is there more resources you can recommend to learning automation? It a part of programming I really enjoyed.

4

u/frex4 Sep 18 '20

Since you already took this task, I have some ideas for this as well, I want to know if my approach is doable and if there's anything you can help to improve my approach.

  1. This task will need to work with Excel => use openyxl or pandas will help we read the Excel and construct a list to fetch.

  2. I would use Selenium and navigate to the site. Type in the search bar with names we have from the list.

  3. Save PDF, which is tricky. If /u/Uh_IDontKnow0 doesn't need text-pdf file, we can capture as a picture then save as PDF => easiest way. If he needs text-selectable pdf, maybe save file as HTML then use pdfkit to convert?

3

u/someguy_000 Sep 18 '20

Hi, can you please help me understand exactly what selenium does? googling around hasn't made it too clear... I have a lot of experience with pandas and working with APIs but not so much with web scraping.

2

u/frex4 Sep 19 '20

Hello there, first off you might need to know about web driver.

So basically, our normal browsers (chrome, firefox, safari... etc) will provide you a "web driver". This binary will init a browser session that is controllable with web driver command, for example like OP's task: open a website, look for an element (like search bar), type something in it, look for "search" button, click on the button, screenshot the site.

Web driver can control the browser, but you have many drivers, having different interfaces. And also you will want to use your programming language to make a script.

Selenium is a module/package/library where it provides you API to control web driver, in your programming language.

So instead of telling web driver to do something in driver's command, you just need to tell Selenium to do so, in your favorite programming language (Python/Java/Ruby... etc).

→ More replies (2)
→ More replies (3)
→ More replies (5)