TL, DR Selenium is one of the main libraries for browser automation and web scraping. Sometimes it is painful to integrate with browsers that are installed as Snap packages, this guide gives you a few examples for a correct configuration. What are Snap packages? Snap packages is the new and preferred way to distribute applications… Continue reading Use Python Selenium with Snap browsers
Category: Python
Set your User Agent with Python Requests, Scrapy, and Selenium
TL, DR When you crawl the web to collect data you should set a User Agent that identifies you. Or one that hides the tool you are using. Here you can find how to set the User Agent in Python Requests, Scrapy, and Selenium. What is the User Agent? A User Agent is a string… Continue reading Set your User Agent with Python Requests, Scrapy, and Selenium
MongoDB aggregation: save results in a Pandas DataFrame
TL, DR MongoDB is one of the leading NoSQL databases, and its aggregation framework enables powerful queries, as well as data operations. We will see how to save results from aggregation pipelines into a Pandas DataFrame. From MongoDB to Pandas I already provided an introduction to MongoDB and Compass in a previous post for my… Continue reading MongoDB aggregation: save results in a Pandas DataFrame
MongoDB aggregation: match a field with values in a list
TL, DR MongoDB is one of the leading NoSQL databases, and its aggregation framework enables powerful queries, as well as data operations. We will see how to match a field with values in a list to help you select. Matching values in a list I already provided an introduction to MongoDB and Compass in a… Continue reading MongoDB aggregation: match a field with values in a list
Fetch and display an image with PyScript
TL, DR PyScript is a new and cool piece of technology that let you use Python in the browser. In this tutorial we will create a webpage that fetch and display a cat image. More tutorials on PyScript to come! Use PyScript to fetch and display an image Python is famous for running everywhere. Jupyter… Continue reading Fetch and display an image with PyScript
Alpha Vantage API: Free financial markets data
TL, DR Alpha Vantage is a free API where you can get financial markets data. It provides you stocks, Forex, and cryptocurrency data feed, as well as many technical and economic indicators. You can get a free API key at this link. You can get higher limits for API utilization by holding Alpha Vantage Coins… Continue reading Alpha Vantage API: Free financial markets data
Pandas: Convert list to dummies
TL, DR Sometimes you may have a list in a Pandas DataFrame column and you are looking to get individual dummy columns for further elaborations. Here a very short guide about how to convert a list to individual dummies. From list to dummies In many cases during data exploration and wrangling you will find that… Continue reading Pandas: Convert list to dummies
Scrapy: Select elements containing a specific text
TL, DR Scrapy is one of the top frameworks for web scraping in Python. Often you need to select some element where you already know part of its text. This post shows you how to select elements containing a certain text with CSS and XPATH selectors. How to select elements containing a certain text in… Continue reading Scrapy: Select elements containing a specific text
Call an API from PyScript
TL, DR PyScript is a new and cool piece of technology that let you use Python in the browser. In this tutorial we will call an API from PyScript and display the result on our webpage. More tutorials on PyScript to come! How to make HTTP requests from PyScript to an external API? PyScript, a… Continue reading Call an API from PyScript
PyScript REPL in a webpage
TL, DR PyScript is a new and cool piece of technology that let you use Python in the browser. In this tutorial we will embed a PyScript REPL in a webpage. More tutorials on PyScript to come! Embed a PyScript REPL in a webpage Python is famous for running everywhere. Jupyter Notebooks enabled professionals and… Continue reading PyScript REPL in a webpage