![](https://img-blog.csdnimg.cn/20201014180756928.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
python
qichengaini
这个作者很懒,什么都没留下…
展开
-
python 采集360问答
import requestsimport refrom bs4 import BeautifulSoupfrom lxml import etreeimport chardetimport osfrom time import sleepheader={ 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/72.0.3.原创 2020-09-01 10:41:23 · 613 阅读 · 0 评论 -
python采集网站时乱码怎么解决
res= requests.post(url=url,headers=headers).textmyencoding='gbk'res = res.encode('ISO-8859-1').decode(myencoding, 'replace')有时候网站编码不是utf-8 采集的时候是iso-8859 所以这个时候需要转换下编码。原创 2020-08-27 15:00:08 · 149 阅读 · 0 评论 -
亚马逊商品排名采集
# -*- coding:utf-8 -*-import requestsimport refrom lxml import etreeurl='https://www.amazon.es/s?me=A176UH6T0U3XNJ&marketplaceID=A1RKKUPIHCS9HS'headers = { 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_0) AppleWebKit/537.36 .原创 2020-08-14 18:56:08 · 496 阅读 · 0 评论 -
python如何采集图片
python 单个图片下载到本地#coding utf-8import requestsurl='https://imgconvert.csdnimg.cn/aHR0cHM6Ly9tbWJpei5xcGljLmNuL21tYml6X3BuZy90cm01Vk1lRnA5a0pIejVYc2YwM1lCa0tnOTNyd3I2S0p1c2xWb3BpYXpBVW1WOWNEeG5sYzlZMWdWeExyWGMxUUxXWTdhZG9DSzJUNnozZDdYNEs5MmcvNjQw?x-oss-原创 2020-08-11 15:57:56 · 566 阅读 · 0 评论