How to Scrape Wikipedia Pages to Create a Question-Answer Database?

Why Create a QA Database? A good question often opens up new perspectives and new ways of thinking. But that’s not why I had to create a Question-Answering database. Question-Answering (QA) databases play an important role in researching and developing large language models (LLMs). These databases have two primary applications: Traditionally, QA databases can be … Read more

Get First N Google Search Results in Python (Official Way)

In this article, I’ll share my method of retrieving the first n Google search results for a given keyword and extract the text content from the resulting URLs. The search_google(query, num_results) function performs a search using the Google Custom Search JSON API, with the search query and the desired number of results (num_results) as parameters. … Read more

Regex to Extract All Email Addresses from a String ✅ (Tutorial + Online Tool)

I have just created this small helper tool to extract all email addresses from a huge text file or string. Simply copy and paste your text into the field and click “Extract Emails“: 👇 Email Extractor Enter Text: Extract Emails Copy to Clipboard Extracted Emails: JavaScript Regex In the online tool above, I used a … Read more

Python Async Requests: Getting URLS Concurrently via HTTP(S)

As a Python developer, you may often deal with making HTTP requests to interact with APIs or to retrieve information from web pages. By default, these requests can be slow and block your program’s execution, making your code less efficient. This is where Python’s async requests come to the rescue. Asynchronous HTTP requests allow your … Read more

How to Download a Zoom Video from a URL in Python?

To download a Zoom video in Python, first install the requests library using pip install requests. Then, use the requests.get() method to fetch the video content from the Zoom URL and save it to a file with .mp4 extension. Ensure you have the necessary permissions and note that some videos may require authentication or additional … Read more

Python Code for Getting Historical Weather Data

To get historical weather data in Python, install the Meteostat library using pip install meteostat or run !pip install meteostat with the exclamation mark prefix ! in a Jupyter Notebook. If you haven’t already, also install the Matplotlib library using pip install matplotlib. Then, copy the following code into your programming environment and change the … Read more

How to Open a URL in Python Selenium

Selenium is a powerful tool for automation testing, allowing you to interact with web pages and perform various tasks, such as opening URLs, clicking buttons, and filling forms. As a popular open-source framework, Selenium supports various scripting languages, including Python. By using Python and Selenium WebDriver, you can simplify your web testing processes and gain … Read more

Top 10 Python Libraries to Create Your Telegram Bot Easily (GitHub)

As a Python developer interested in building Telegram bots for pure fun and enjoyment, I bring you my curated list of top Python libraries that powerfully streamline bot creation. 1. python-telegram-bot The python-telegram-bot is one of the most straightforward libraries for building bots for the Telegram app. Easy installation: 👇 pip install python-telegram-bot –upgrade It … Read more