Found 10784 Articles for Python

Extracting an attribute value with beautiful soup in Python

Rohan Singh
Updated on 10-Jul-2023 13:41:53

6K+ Views

To extract an attribute value with the help of Beautiful Soup we need to parse the HTML document and then extract the required attribute value. Beautiful Soup is a Python library that is used to parse HTML and XML documents.BeautifulSoup provides several methods to search and navigate the parse tree, making it easy to extract data from the documents. In this article, we will extract attribute values with the help of Beautiful Soup in Python. Algorithm You can follow the below-given algorithm to extract attribute values with beautiful soup in Python. Parse the HTML document using the BeautifulSoup ... Read More

Extract the title from a webpage using Python

Rohan Singh
Updated on 10-Jul-2023 13:37:58

3K+ Views

In Python, we can extract the title from a webpage using Web scraping. Web scraping is the process of extracting data from a website or webpage. In this article, we will scrap the title of a webpage using the Requests and BeautifulSoup libraries in Python. Extracting Title from Webpage Method 1: Using Request and Beautiful Soup libraries We can use the request and Beautiful Soup libraries of Python to extract titles from a webpage. The requests library is used to send HTTP requests to a website and get its response. We then use the response object to extract the HTML ... Read More

Draw a circle using Arcade in Python3

Rohan Singh
Updated on 10-Jul-2023 13:29:26

106 Views

Arcade is a Python library that is used to create 2D games and applications. It is an easy-to-use library that provides various functionality to create an interface for drawing shapes and images on the screen. In this article, we will use Arcade and draw a Circle in Python3. Installing Arcade Before we can start drawing circles, we need to install the Arcade library. You can install it using pip, the package manager for Python − Pip install arcade Drawing a circle in Arcade Method 1: Using the arcade.draw_circle() method We can use the draw_circle method of the ... Read More

Draw a car using Turtle in Python

Rohan Singh
Updated on 10-Jul-2023 13:27:00

3K+ Views

Turtle is a Python module that is used to create graphics, images, and animation using simple commands. Turtle is a simple and easy tool for beginners to learn programming by creating exciting visuals with it. In this article, we will create a car using a turtle in Python. Step 1: Installing Turtle in Python Before we dive into the code, we need to make sure that the Turtle module is installed in our Python environment. Use the Python package manager to install the Turtle module. To install the turtle module type the following command in your terminal. pip install turtle ... Read More

drag_and_drop_by_offset method – Action Chains in Selenium Python

Rohan Singh
Updated on 10-Jul-2023 13:16:19

555 Views

The drag and drop by offset method is performed using the Action chain API in selenium. It is similar to simple drag and drop in addition to creating the functionality using the offset of the object. In this article, we will create the drag and drop by offset functionality using an action chain in Selenium Python. What is the drag and drop by Offset method? The drag and drop by offset method is an action to drag an element from one location to another using its offset position. Action chin provides a method drag_and_drop_by_offset() which takes two arguments- one ... Read More

Downloading PDFs with Python using Requests and BeautifulSoup

Rohan Singh
Updated on 10-Jul-2023 13:13:08

2K+ Views

Request and BeautifulSoup are Python libraries that can download any file or PDF online. The request library is used to send HTTP requests and receive responses. BeautifulSoup library is used to parse the HTML received in the response and get the downloadable pdf link.In this article, we will understand how we can download PDFs using Request and Beautiful Soup in Python. Installing Dependencies Before using the BeautifulSoup and Request libraries in Python we need to install the libraries in our system using the pip command. To install the request and BeautifulSoup and Request library run the following command in ... Read More

Download XKCD Comics using Python

Rohan Singh
Updated on 10-Jul-2023 13:05:05

576 Views

XKCD is a popular webcomic that features humor, science, and geek culture. The comic is famous for its witty jokes as well as a reference to culture and science. We can download the comic using XKCD API and Python request and pillow library. In this article, we will download XKCD comics using Python. Understanding XKCD API XKCD provides an open API that gives permission to the developers to access the comics using the API. To use the API, we need to send an HTTP GET request to the URL - `http://xkcd.com/info.0.json`. The request returns a JSON object that contains information ... Read More

Download Video in MP3 format using PyTube

Rohan Singh
Updated on 10-Jul-2023 13:03:01

9K+ Views

Pytube is a Python library that is used to download any youtube video easily. It offers a simple and intuitive interface, making it easy to use even for those who are not familiar with programming. It provides the option to download a video in various formats like mp4, mp3, 3gp, webm, etc. In this article, we will learn step by step process of how to download the video in mp3 format using Pytube. Install Pytube Before using the Pytube module we need to download the Pytube library in our system by using the Python package manager. To download ... Read More

Download Instagram profile pic using Python

Rohan Singh
Updated on 10-Jul-2023 13:01:17

1K+ Views

The Instagram profile pic can be downloaded using the Beautiful Soup and Request module in Python.Instagram is one of the most popular social media platforms that allows users to share photos and videos with their followers. As an Instagram user, you might come across some interesting profile pictures that you may want to save or download. In this article, we will download Instagram profile pics using Beautiful Soap and the Instaloader library in Python. Method 1: Using Beautiful Soap and Request module In this method, we send a GET request to the User's Instagram profile URL using the request ... Read More

Download Anything to Google Drive using Google Colab

Rohan Singh
Updated on 10-Jul-2023 12:57:05

2K+ Views

Google Collab is a free online Platform provided by Google that provides CPU, GPU, and other infrastructure to run complex computation and data analysis. Google Collab provides a jupyter notebook environment to run Python code. We can download anything to google drive using google collab by mounting our google drive on Collab. In this article, we will understand how we can download anything to google drive using google collab. Step 1: Setting up google collab If you have a Google account you can open the google collab website and click on “New Notebook” to create a new Jupyter ... Read More

Advertisements