摘要: <div class="uibox-con carpic-list03 border-b-solid"> #即这个标签同时满足三个class:“uibox”、“carpic-list03”、“border-b-solid”。 提取此标签时:html.xpath("//div[contains(@cl 阅读全文
posted @ 2019-03-14 21:58 乔儿 阅读(342) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2019-03-14 15:49 乔儿 阅读(104) 评论(0) 推荐(0) 编辑
摘要: # for url in urls:# url = response.urljoin(url)# print(url)urls = map(lambda url:response.urljoin(url),urls)print(urls)在这里要情调的是map函数运行完之后会生成一个map对象(<m 阅读全文
posted @ 2019-03-14 13:45 乔儿 阅读(777) 评论(0) 推荐(0) 编辑
摘要: url = "https:" + url 或者url = response.urljoin(url) #这里代表的是自动补全url 阅读全文
posted @ 2019-03-14 13:38 乔儿 阅读(689) 评论(0) 推荐(0) 编辑
摘要: 1.通过肉眼识别,然后输入到input里面 from PIL import image Image request.urlretrieve(url,'image') #下载验证码图片 image = Image.open('image') #程序内部打开图片 image.show() #将图片显示出 阅读全文
posted @ 2019-03-14 10:42 乔儿 阅读(552) 评论(0) 推荐(0) 编辑
摘要: import os #创建文件夹 from urllib import request #下载图片 if not os.path.exists('文件夹名字'): #创建文件夹名字 os.mkdir('文件夹名字') img_path = '文件夹名字/' + 图片名字 request.urlretrieve(url=url,filename=img_path) #u... 阅读全文
posted @ 2019-03-14 09:12 乔儿 阅读(984) 评论(0) 推荐(0) 编辑
摘要: 标签如下:<img id="captcha_image" src="https://www.douban.com/misc/cantcha?id=jskdjf" alt="captcha" class="captcha_image"> 使用css选择器:captcha_img = html.css( 阅读全文
posted @ 2019-03-14 09:09 乔儿 阅读(95) 评论(0) 推荐(0) 编辑