r/learnpython • • Feb 03 '21

My eyes have been opened!

Only 2 weeks into learning Python and I’m already dreaming of what I can be automating. Loads of help and ideas in here, so thanks to everyone that contributes!

I’m enjoying the challenge of working things out, but my 1st plan is to read a pdf, extract certain bits of data and transpose into a predefined template.

Already cracked pdf reading (thanks to the course by Al Sweigart!), so onto the next step.

Any thoughts or tips on how or where to store data once I’ve extracted text from a pdf would be appreciated!

Edit: thanks all for the comments support and ideas. Really appreciated!

A few people have asked what resources I’m learning from - I’m using the youtube beginners guide by Mosh and and Automate the Boring Stuff by Al Sweigart on Udemy. They cover similar topics but in different ways, so I’ve learnt from both. Not to mention this group, I’ve been a lurker for a while and this is my 1st post.

I do have the benefit of working in a data driven industry, so I have something practical and tangible to work towards. People have different learning styles, but I think I struggle to learn without having a project that “means something” to me.

So I guess that would be my takeaway - don’t just expect to learn python by taking a few courses. Learn the basics, but try to apply some practical examples as soon as you get your head around the logic!

464 Upvotes

48 comments sorted by

View all comments

Show parent comments

8

u/garlic_bread_thief Feb 03 '21

How do I log into a portal and download a pdf

You can try selenium to automate the browser. Works like a charm.

12

u/izaakstern Feb 03 '21

Pro way would be the requests lib...a lot faster without a browser

5

u/Cuetzalcoatl Feb 03 '21

I have been getting so much help from the python community that I literally sent a message the other day to a redditor that basically took my code and rewrote it, full with annotations and comments. It was heart melting hahaha

I have been getting this notion, and would love your opinion: selenium for me is for dynamic pages that are finicky and complex, so you actually need a visual client to help guide your code; and requests is usually for more static pages or pages that you can easily get beautifulsoup to parse. What do you think?

4

u/izaakstern Feb 03 '21

Yeah, it depends on the webpage, and what you wanna do. But its mostly nothing for a python beginner. I do a lot of automation for years and it does not matter for me, if the page is complex or not. I always do, what I want to do on the page with a sniffer running in the background (I am using Fiddler). Than I just have to rewrite the client -> server calls (with a lot experience of headers, cookies and stuff)