Blog / Python
42 Posts
Python
Python
Python
Python
Scrape images from a certain website
Crawl a picture website Preface First, let's take a look at the quality of the pictures on this website. It's really good. Downloading them one by one is too troublesome, so I'll use Python to download all of them. The website should have about 2000 pictures in total; I'll crawl them all down. Note that this website uses IP anti-crawling, so an IP pool is needed. Otherwise, the IP will be banned after downloading a few pictures. Let's get coding!!! Libraries used first: ```python import os.path import random import requests import re from lxml import ```
查看全文
Python
Optimization of Python Scheduled Tasks
To optimize the code and reduce CPU usage, use Python's schedule library to implement scheduled tasks.
查看全文