This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
importrequests
importos
fromurllib.parseimportquote
frompathlibimportPath
# 配置参数
KEYWORD="工程师"# 搜索关键词
SAVE_DIR="/root/imgs4"# 保存路径(需确保有写入权限)
NUM_IMAGES=20# 目标数量
HEADERS={
"User-Agent":"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/116.0.0.0 Safari/537.36",