earn the White PyBites Ninja earn the Yellow PyBites Ninja earn the Orange PyBites Ninja right arrow earn more PyBites Ninja belts and certificates
The best way to learn to code in Python is to actually use the language.

Our platform offers effective Test Driven Learning which will be key to your progress.


Join thousands of Pythonistas and start coding!


Join us on our PyBites Platform
Click here to code!

Building a Python Tips API with Django REST Framework and Deploying it to Digital Ocean

Posted by Bob on Tue 05 March 2019 in Django • Tagged with Django, APIs, Django REST Framework, tips, Digital Ocean, Django Commands, Postman, Nginx, postgres, Gunicorn, BeautifulSoup, requests, curl, SSH, Linux, deployment • 15 min read

In this article I will show you how to build a simple API for our growing collection of Python tips. First we make a simple Django app, defining the model. Next we use Django REST Framework to make an API supporting common CRUD operations. Then we will test it out using curl, Postman and Django REST's browser front-end. Lastly we deploy the API to Digital Ocean so we can start using it via our Slack with a Slash Command, which I will cover in the next article. Sounds exciting? You bet it is! Let's jump straight in!


Continue reading

Generating Beautiful Code Snippets with Carbon and Selenium

Posted by Bob on Tue 26 February 2019 in Tools • Tagged with Selenium, BeautifulSoup, requests, collections, random, urllib, carbon, tips, pprint, automation • 7 min read

Did you notice our Python tips lately? They looks more sexy, don't they? That's thanks to Carbon which lets you create beautiful images of your source code. As much as I love its interface though, what if we can automate this process generating the image for us? That's what we did and posting new tips to Twitter is now a breeze. In this article I will show you how using a bit of BeautifulSoup and selenium. Enjoy!


Continue reading

How to Parse Hidden HTML With Selenium Headless Mode and Deploy it to Heroku

Posted by Bob on Tue 19 February 2019 in Tools • Tagged with Selenium, headless, Heroku, tweepy, argparse, Slack, Packt, books, automation, parsing, BeautifulSoup, requests, namedtuple, Scheduler, git, buildpacks, environment variables • 6 min read

Ever wondered how you scrape hidden (or JS generated) HTML? Selenium is your friend. Ever wondered how to run it without a browser popping up? Use headless mode. How would you run it remotely? Use Heroku. And how about autoposting to Slack and Twitter? With the right libraries and API setup little code is needed. In this 10 step guide I will show you how to build a Packt Free Learning Notifier which will accomplish all these tasks. Ready to learn some nice automation skills in Python?


Continue reading

Code Challenge 22 - Packt Free Ebook Web Scraper - Review

Posted by PyBites on Mon 12 June 2017 in Challenges • Tagged with codechallenges, webscraping, BeautifulSoup, Selenium, Packt, Pybonacci, ebooks, community, automation, sponsoring • 3 min read

In this article we review last week's Packt free ebook code challenge. We really scratched our own itch building both a notification service and an ebook download manager.


Continue reading

Next Time I Will Use Pandas to Parse Html Tables

Posted by Bob on Thu 08 June 2017 in Concepts • Tagged with BeautifulSoup, regex, Pandas, parsing, data, data cleaning, energy, json, csv, html • 2 min read

Last week I did some html table parsing with BeautifulSoup and regex. It turns out there is an easier way to do this: Pandas.


Continue reading

Code Challenge 22 - Packt Free Ebook Web Scraper

Posted by PyBites on Mon 05 June 2017 in Challenges • Tagged with codechallenges, webscraping, BeautifulSoup, Selenium, Packt, Pybonacci, ebooks, community, automation, sponsoring • 2 min read

Hi Pythonistas, a new week, a new 'bite' of Python coding! This week we will do some web scraping of Packt's daily free ebook, sending out daily notifications. This week we even have a unique opportunity to sponsor the Python Community, read on ... and happy coding!


Continue reading

Code Challenge 21 - Electricity Cost Calculation App - Review

Posted by PyBites on Mon 05 June 2017 in Challenges • Tagged with codechallenges, calculation, electricity, Flask, Django, cli, data, BeautifulSoup, Python Anywhere, Pythonista 3 • 2 min read

In this article we review this week's code challenge #21 for which we got some nice PRs.


Continue reading

Create a Simple Web Scraper with BeautifulSoup4

Posted by Julian on Wed 11 January 2017 in Tools • Tagged with python, tips, tricks, code, pybites, beautifulsoup, bs4, webscraping, namedtuples • 4 min read

Learn to create a simple web scraper in Python using BeautifulSoup4


Continue reading