DrissionPage: Unifying Browser Automation and HTTP Requests in Python

Web automation is frequently used to monitor e-commerce prices. The following script demonstrates how to track a product price and trigger an API notification when a target threshold is met. This example utilizes the mixed mode to handle navigation and data extraction seamlessly. from DrissionPage import WebPage import requests import time # I ...

Posted on Sun, 17 May 2026 13:29:16 +0000 by Dodon

Web Scraping and Visualization Techniques for Location Data

Pandas can be used to load and filter Excel datasets containing geographic coordinates. For example, to extract Starbucks store locations in Shanghai from a spreadsheet, read the file and apply a city-based filter. import pandas as pd data_frame = pd.read_excel("stores_data.xlsx") shanghai_locations = data_frame[data_frame['city'] == ...

Posted on Sun, 17 May 2026 08:54:17 +0000 by rckehoe

Extracting Web Table Data and Exporting to Excel Using a Tampermonkey Script

Often we need to download tabular data displayed on a web page as an Excel file. When the site does not provide a suitable download option, a custom script can be used to gather the data and export it. Using a Tampermonkey (userscript) makes it easy to share the solution with others. Below are two practical approaches: one that simulates manual ...

Posted on Sun, 17 May 2026 06:41:49 +0000 by WendyB

Building Distributed Scrapy Spiders with Redis

RedisSpider Overview RedisSpider extends Scrapy's base Spider class to enable distributed crawling. Instead of using a static start_urls list, this spider reads URLs from a Redis queue. Key Differences from Standard Spider The main modifications involve imports, inheritance, and replacing the static URL list with a Redis key: from scrapy_redis. ...

Posted on Sun, 17 May 2026 03:26:31 +0000 by glassroof

C# HTTP Helper for Web Scraping with Automatic Encoding Detection and Cookie Support

This utility class simplifies making HTTP requests in C# while automatically handling character encoding, gzip-compressed responses, cookies, and common request headers. It is especially useful for web scraping scenarios where the target page's encoding is unknown or inconsistent. Core Features Automatic detection of page encoding from HTML me ...

Posted on Fri, 15 May 2026 16:37:01 +0000 by RDKL PerFecT

Scraping Douban Book Data with Scrapy

Scrapy is an asynchronous web crawling framework built on Twisted, enabling efficient and scalable data extraction in Python. To begin scraping book information from Douban’s web site, first install Scrapy using pip: pip install Scrapy -i https://pypi.tuna.tsinghua.edu.cn/simple Create a new project named douban: scrapy startproject douban cd ...

Posted on Fri, 15 May 2026 10:30:34 +0000 by webmaster1

Parsing HTML and XML Data in Python with re, BeautifulSoup, and lxml

Regular Expressions with the re Module The re module provides pattern matching operations for string processing, often used for data etxraction and validation. import re # Extract all numeric sequences from a string number_list = re.findall(r'\d+', 'ID: 12345, Code: 67890') print(number_list) # Use an iterator for memory-efficient matching nu ...

Posted on Thu, 14 May 2026 21:47:22 +0000 by jjfletch

Extracting Audio Files with Python Web Scraping

To extract audio files from websites, Python's requests library can be used to send HTTP requests and retrieve data. The process involves identifying audio URLs from network requests and saving the files locally. First, inspect the network activity of a target webpage using browser developer tools. For example, on a music site like gequbao.com, ...

Posted on Thu, 14 May 2026 15:19:10 +0000 by uatec

Quick Python Web Scraping Guide: Choose Your Meal in Minutes

This process isn't technically complex—it's more about patience and attention to detail. That’s why many people choose web scraping as a side job. Though it’s time-consuming, the technical barrier is relatively low. After this lesson, you won't think web scraping is hard anymore. You may later encounter challenges like session management or byp ...

Posted on Mon, 11 May 2026 06:37:04 +0000 by sahel

Parsing HTML Content with Beautiful Soup in Python

Beautiful Soup is a Python library for parsing HTML and XML documents, creating parse trees that are helpful for extarcting data from web pages. It provides simple methods for navigating, searching, and mdoifying the parse tree. Installation pip install beautifulsoup4 Basic Usage from bs4 import BeautifulSoup html_doc = """ &lt ...

Posted on Sun, 10 May 2026 16:24:05 +0000 by cornix