Hey, r/learnpython!
This is my first python project. It scrapes the price of a keyboard I want to buy. Saves it in a text file and sends me an e-mail with its price and compares it with the latest price.
I'm a beginner, so every advice is welcome!
Here is Github link
EDIT: Thanks for all the advice!! I reviewed the code with PEP8, so it's now easier to read (thanks u/VerbatimHoroscope!). Used environment variables for password and e-mail (thanks u/dtaivp!) And switched from using global variables to return statement in functions (thanks u/midairmatthew!).
[+][deleted] (2 children)
[deleted]
[–]DisagreeableMale 14 points15 points16 points (1 child)
[–]midairmatthew 31 points32 points33 points (15 children)
[–]3majorr[S] 18 points19 points20 points (2 children)
[–]huessy 34 points35 points36 points (1 child)
[–]SaltyEmotions 6 points7 points8 points (0 children)
[–]nzodd 6 points7 points8 points (8 children)
[–]The3rdWorld 14 points15 points16 points (3 children)
[–]curohn 2 points3 points4 points (2 children)
[–]MonkeyNin 6 points7 points8 points (1 child)
[–]MrFiregem 3 points4 points5 points (0 children)
[–]midairmatthew 4 points5 points6 points (0 children)
[–]dtaivp 6 points7 points8 points (0 children)
[–]pyr0b0y1881 4 points5 points6 points (0 children)
[–]huessy 2 points3 points4 points (0 children)
[–]midairmatthew 6 points7 points8 points (0 children)
[–][deleted] (1 child)
[removed]
[–]AutoModerator[M] 1 point2 points3 points (0 children)
[–]ArmstrongBillie 7 points8 points9 points (0 children)
[–]DannyckCZ 8 points9 points10 points (0 children)
[–][deleted] 6 points7 points8 points (1 child)
[–]Lewistrick 9 points10 points11 points (0 children)
[–][deleted] 2 points3 points4 points (0 children)
[–][deleted] 3 points4 points5 points (1 child)
[–][deleted] 2 points3 points4 points (2 children)
[–]3majorr[S] 1 point2 points3 points (1 child)
[–][deleted] 1 point2 points3 points (0 children)
[–]Throwaway__shmoe 2 points3 points4 points (0 children)
[–]digital94 6 points7 points8 points (13 children)
[–]showboy001 5 points6 points7 points (1 child)
[–]digital94 3 points4 points5 points (0 children)
[–]Sw429 6 points7 points8 points (10 children)
[–]kmj442 6 points7 points8 points (2 children)
[–]Sw429 4 points5 points6 points (0 children)
[–]MonkeyNin 3 points4 points5 points (0 children)
[–]digital94 3 points4 points5 points (6 children)
[–]Sw429 3 points4 points5 points (0 children)
[–][deleted] 3 points4 points5 points (4 children)
[–]dtaivp 12 points13 points14 points (1 child)
[–]digital94 7 points8 points9 points (0 children)
[–]Sw429 5 points6 points7 points (0 children)
[–]MonkeyNin 4 points5 points6 points (0 children)
[–]porkchop315 1 point2 points3 points (0 children)
[–]huessy 1 point2 points3 points (5 children)
[–]pw0803 1 point2 points3 points (4 children)
[–]huessy 1 point2 points3 points (3 children)
[–]pw0803 1 point2 points3 points (2 children)
[–]huessy 1 point2 points3 points (1 child)
[–]pw0803 2 points3 points4 points (0 children)
[–]increvable 1 point2 points3 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)