loading...

Day 1 of the #31DaysOfCode

helloiamarra profile image Arra ・2 min read

Reading the posts from other people on this platform that participated in the #100DaysOfCode challenge, I decided to join as well. However, I decided not to follow the rules strictly according to https://www.100daysofcode.com/. Instead tweeting everyday I will make a short update every 5 or 6~ish days what my progress is. Furthermore, I am going to do this for 31 days straight instead of 100. Lastly, I am going to try to code every day on a consistent basis but the time coding will vary from a couple of minutes to hours. Still, I find it more important to develop good, healthy habits than forcing myself to do something every day for a hour.

Goal of the challenge

Learning Python.

Why

I have mostly developed in JavaScript & C# and would love to expand and improve my knowledge in programming using Python.

Day 1

For the first project of Python I decided to build a simple web scraper app. It checks the title and the price of the webscraper and send a notification to your email adress if the price is lower/higher than the condition you have put it.

A very valuable resouce I found was this video of Dev Ed. It explains in detail how to build the project and what each concept is.

For the web scraper I decided to use beautifulsoup.

First struggles

When I was running the application, I stubled upon a few problems:

  • At first the app wasn't able to import the packages of the web scraper. Turnt out I had installed the 32-bit edition instead of the 64 bit. I had to re-install the packages.
  • Second, installing the packages itself is completely different compared to installing packages on Linux. I googled the problems and managed to find this thread on Stackoverflow that helped me to figure this problem.

For testing the web scraper I decided to use this product on Amazon DE and made a function which should send me an email if the price drop below 45 euro.

For sending the mail I use the SMTP protocol. SMTP in Python send a message to the SMTP server telling what email to send. You can easily import the smtplib package from Python.

Now after running the application it should display the price, the title and a notification which confirm the email has been sent. And it did!

Application succesful runned
After this, I also received an e-mail that contains the link to the product I am tracking the price of.

Confirmation email has been sent

So far the app works. In the next post I will refactor the code and add other functionalities to the application. I will also read more in Python documentations of certain methods I want to learn more about.

I will keep you guys updated on my process!

Click here for the repository

Posted on Dec 1 '19 by:

helloiamarra profile

Arra

@helloiamarra

I am software tester who build things, break things, test things and fix things.

Discussion

markdown guide