看了下代码都是正确的,表达式也无误,但就是爬不到东西,爬取显示为0,感觉是keyword解码的问题
keyword="江苏"
def ip(ippools):
thisip=random.choice(ippools)
def ua(uapools):
thisua=random.choice(uapools)
for i in range(0,2):
url='https://xxxxxxxxxxxx?q='+keyword+'&s=44'
res=requests.get(url,headers=ua(uapools),proxies=ip(ippools))
pat='"pic_url":"//(.*?)"'
imglist=re.findall(pat,res.text)
print(len(imglist))