摘要:
def fact(x): if x == 1: return 1 else: return x * fact(x-1) 阅读全文
摘要:
-- 查询所有学生的姓名和性别(条件运算) select stuname as 姓名, case stusex when 1 then '男' else '女' end as 性别 from tb_student; select stuname as 姓名, if(stusex, '男', '女') 阅读全文
摘要:
# coding:gbk 阅读全文
摘要:
lables = ['nvbfge','cvbfg','nfsd','jklibn','dfgrt','muyh','ytug','nghmdf','gfhasfecxv']for lable in lables: print(lable) urls_0 = response.xpath("//ma 阅读全文
摘要:
# 通过enumerate函数处理列表之后再遍历可以同时获得元素索引和值 for index, elem in enumerate(list1): print(index, elem) 阅读全文
摘要:
RETRY_ENABLED = True #打开重试开关RETRY_TIMES = 3 #重试次数DOWNLOAD_TIMEOUT = 3 #超时RETRY_HTTP_CODES = [429,404,403] #重试HTTPERROR_ALLOWED_CODES = [429] #上面报的是403 阅读全文
摘要:
response = requests.post(url=url, data=data, headers=headers)# 获取requests请求返回的cookiecookie = requests.utils.dict_from_cookiejar(response.cookies)retur 阅读全文
摘要:
import time, threading def demo1(value1, value2=None): print("%s threading is printed %s, %s"%(threading.current_thread().name, value1, value2)) time. 阅读全文
摘要:
class proxyMiddleware(object): def __init__(self): self.ip_pool_cc = [] self.get_ip_url_cc = 'http://xxxxx' self.ip_pool_cq = [] self.get_ip_url_cq = 阅读全文
摘要:
[scrapy] DEBUG:Filtered duplicate request:<GET:xxxx>-no more duplicates will be shown 不会显示更多重复项, 其实这个的问题是,CrawlSpider结合LinkExtractor\Rule,在提取链接与发链接的时候 阅读全文