Category: Web Scraping

  • Python Exercise for Beginners – Implementing One Hot Encoding

    Python Exercise for Beginners – Implementing One Hot Encoding

    In today’s Python exercise we will create a one-hot encoding algorithm to convert categorical data to a numerical format. The reason why we need to do this is that machine learning algorithms only can deal with numbers, not strings. What is One Hot Encoding? One-hot encoding is a way of representing categorical information in binary […]

  • Python Selenium Webdriver.implicitly_wait(seconds)

    Python Selenium Webdriver.implicitly_wait(seconds)

    This method configures the Python Selenium web driver to wait up to N seconds before it gives up searching for an element on a page. By default, implicitly_wait is set to 0, which means that if an element is not immediately available, it will fail immediately if, upon loading the page, it doesn’t find the […]

  • How to find the Parent Element in a page using Python Selenium WebDriver

    How to find the Parent Element in a page using Python Selenium WebDriver

    This is a quick article to show how you can easily get the parent element of an HTML element using Selenium Webdriver with Python. There is more than one way. Let’s suppose that we want to get an HTML button that has no id or unique CSS class from within an HTML page: 1. Getting […]

  • Python Exercise for Beginners – Getting a list of IP addresses to Whitelist for Cloudflare

    Python Exercise for Beginners – Getting a list of IP addresses to Whitelist for Cloudflare

     In today’s video we are going to be working on a real-life Python script for Devops. Many websites in the world today are protected against DDoS attacks by Cloudflare.Cloudflare provides this protection by serving as an intermediary to all traffic from the web. So instead of a website visitor connecting to the server hosting the […]

  • Python Exercises For Beginners – #1 – Sum all integers from Zero to N

    Python Exercises For Beginners – #1 – Sum all integers from Zero to N

    Create a Python function that sums all the numbers from 0 to a number N. If a non-positive or a non-integer number is provided, the function should return 0. This Google Colab notebook is part of my “Python Problemns for Beginners” Youtube series: https://youtube.com/playlist?list=PL3OV2Akk7XpC-fsHuJ3RLpnzOXmED7oAI In this video, the first in the series, I show you […]

  • How to Render a Panda Data Frame as HTML

    How to Render a Panda Data Frame as HTML

    Sometimes it might be useful to convert a Panda Dataframe to HTML. For instance, you might want to render a panda data frame inside a web page, outside Jupyter Notebook. You can do this by calling the df.to_html() function. Where df is the Panda data frame that you would like to render. Let’s first create […]

  • How to make a Python Bot

    How to make a Python Bot

    I am going to show you what you need to do to create a Python bot of your own by giving you a general recipe that you can extend at your will. What is a Python Bot A Python bot is a script that runs 24/7 hours, without needing to sleep or rest, and can perform […]