# -*- coding:utf-8 -*-
import os
import requests
import urllib
from pyquery import PyQuery
import uuid
from pypinyin import pinyin
import unicodedata
headers = {
"User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome"
"/75.0.3770.142 Safari/537.36"
}
def href_url_download():
# 1.填写要爬取关键词的list.txt
keyword_list = open("list.txt", 'r', encoding='utf-8')
lines = keyword_list.readlines()
keyword_list.close()
for keyword in lines:
keyword = keyword.strip()
print(keyword)
# ------------------------汉字转化成拼音-------------------------------------
# word = pinyin(keyword)
# pin_yin = "".join(str(i[0]) for i in word)
# print(pin_yin)
# res = unicodedata.normalize('NFKD', pin_yin).encode('ascii', 'ignore').decode("ascii")
站酷海洛网图片爬虫
最新推荐文章于 2024-09-01 08:28:52 发布
本文介绍如何利用Python进行站酷海洛网的图片爬取,包括解析网页结构、设置请求参数和保存图片等内容,涉及网络请求库和文件操作技术。
摘要由CSDN通过智能技术生成