Fading Coder

One Final Commit for the Last Sprint

Extracting Danmaku and Comments from Bilibili

Extracting Danmaku and Comments from Bilibili Scraping Danmaku To extract danmaku from Bilibili, follow these steps: Analyze the Bilibili webpage content - Open developer tools with F12 - Find the network section where most webpage elements are located. Identify the necessary parameters like aid and...

Implementing Concurrent Web Scraping with Multiprocessing and Multithreading

Concurrency in Web Scraping Web scraping can be significant accelerated by leveraging concurrency through multiprocessing or multithreading. Understanding the distinction between processes and threads is essential for choosing the right approach. A process represents the smallest unit of resource al...

Understanding Web Scraping: Core Concepts and HTTP Fundamentals

Introduction to Web Crawlers A web crawler is a program designed to collect data from the internet. At its core, a crawler simulates a browser to access websites and extract the required information. Crawlers fall into two main categories: General-Purpose Crawlers and Focused Crawlers. General-Purpo...

Concurrency Patterns in Web Scraping

Coroutines Executing Multiple Tasks Concurrently import asyncio async def task_one(): for _ in range(5): print('task-one...') await asyncio.sleep(1) print(123) async def task_two(): for _ in range(5): print('task-two...') await asyncio.sleep(1) print(456) loop = asyncio.get_event_loop() coro_list =...

Downloading High-Resolution Wallpapers from Netbian with Python

Define a helper function to ensure directory existence: import os def ensure_directory_exists(directory_path): if not os.path.exists(directory_path): os.makedirs(directory_path) Implement the main proecssing functino: import os import requests from bs4 import BeautifulSoup def retrieve_wallpaper_pag...

Automating Huya Video Download with Selenium

Exploring the use of Selenium to extract video URLs and save them locally, focusing on videos under five minutes in duration from the first page only. Selenium is preferred over requests due to challenges such as complex data structures, encrypted APIs, or difficult-to-determine video URL pattersn....

Implementing a Class-Based Web Scraper for Baidu Image Search with Node.js

const phantom = require('phantom'); const fs = require('fs'); const cheerio = require('cheerio'); const request = require('request'); class ImageScraper { constructor() { this.searchUrl = 'https://image.baidu.com/search/index?ct=201326592&z=&tn=baiduimage&word=%E6%BC%AB%E5%A8%81%E5%9B%BE...

Obtaining Valid Cookies for Web Scraping: Browser Automation Approach for Anti-Scraping and Encrypted Cookie Scenarios

When building web scrapers or sending simulated HTTP requests, especially when working with sites that use captchas, anti-scraping protected sites often rotate or invalidate cookies on a regular basis. Manually copying cookies from a browser for reuse quickly becomes non-functional. To bypass this r...

Building a Python Web Crawler: Core Architecture, Request Handling, and DOM Parsing

Python provides a highly efficient ecosystem for developing web crawlers due to its streamlined standard library and robust third-party packages. When fetching web documents, Python's built-in modules offer straightforward APIs compared to statically typed languages, while its dynamic nature allows...

Configuring Chrome Browser Options with Selenium and Python

Background When using Selenium for browser rendering to scrape websites, the default is a clean Chrome browser. However, we often use browser extensions, proxies, or other customizations during normal browsing. Correspondingly, when scraping with Chrome, we may need to apply specific configurations...