pic

API更新#图书信息查询ISBN2.0

江枫思渺然 提交于 2019-12-06 01:04:36
ISBN图书查询 自2019年5月8日公布isbn查询接口1.0至今,该图书数据查询服务已被调用八万余次,查得图书11653本,感谢一直使用和关心这个接口的朋友们! 目前网站域名将于2019年12月11日到期, qiaohaoforever.cn 域名将停止服务,请目前还是使用此域名接口的朋友注意调整新的接口,如有不便之处请多包涵。 关于更新 图书信息查询 isbn2.0 接口新增了部分开发者感兴趣的字段, 图书简介、作者简介、目录、原文摘要、评论赞同数 等,具体请见下方字段说明。针对外国书刊译者信息不统一的情况,这里采用图书摘要的字段显示 作者、译者、出版社、出版时间、价格 等。后期更新,字段以目前版本为主,尽量不改变现有字段含义,增加新的字段名。 架构调整 在服务架构上也做了一些调整,1.0版本为单机服务,2.0版本采用两台服务器 负载均衡 的方式分担压力,缓存机制优化等。 关于爬虫 根据日志可以看到,八万多次调用中也有明显的爬虫调用迹象,作为一名开发爱好者,我深刻的清楚大家没有办法忍住看到接口不爬的感情,为了服务于大家的热情,我并没有在反爬虫的方向做太苛刻的防守,但太过高频的爬虫容易触发豆瓣的 反爬虫机制 ,导致接口无法获取最新的图书信息,所以,对于 爬虫单位时间爬取频率 做了部分限制🚫,望各位爬虫老哥记得设置一下爬取间隙,稍微sleep一下,温柔一点,哈哈哈😂

福利爬mzitu

陌路散爱 提交于 2019-12-05 20:05:49
导入库 import os import requests from bs4 import BeautifulSoup import time  生成请求headers def res_headers(): headers = { 'User-Agent': 'Mozilla/5.0 ', 'Referer':'https://i5.meizitu.net/pfiles/style.css?091102', } return headers 网站请求 def get_page(url): headers=res_headers() # 创建session s = requests.session() s.keep_alive = False # 获取页面 res = s.get(url,headers=headers) html = res.text return html   获取页面all girls的详情页url def get_all_girls(url): html = get_page(url) # 构建soup页面 soup = BeautifulSoup(html, 'lxml') # 获取 class_='archives' 下的所有 'a'标签 total_info = soup.find(class_='archives').find_all('a') #

XC8 error 224: illegal # directive (first line)

女生的网名这么多〃 提交于 2019-12-05 19:41:51
I'm using Microchip's XC8 compiler. They want me to #include <xc.h> instead of including a chip-specific header. However, when I add this code on the first line of my code, I'm getting the error: Error [224] C:\...\main.c; 1.4 illegal "#" directive When I place a line feed before the directive, I don't get the error. Why is this? My full code: #include <xc.h> #pragma config OSC =INTIO67, WDT = OFF, LVP = OFF, PBADEN = OFF void main() { while (1); } With the line feed, the code looks just the same, but with a blank line on top. One thing that may cause this is corruption or other characters at

VS20XX VC++设置相对路径

孤者浪人 提交于 2019-12-05 19:02:19
在D:\Code目录下有一个test的项目,项目结构如下图: └─test │ test.sln │ ├─pic │ pic.bmp │ └─test │ test.cpp │ test.vcxproj │ └─xxxx xxxx.h 此图可用CMD命令 tree /f >tree.txt 生成,详见https://blog.csdn.net/masterft/article/details/1671672 现在工程中想使用xxxx.h 以及 pic.bmp方法如下: 工程属性--》属性页--》VC++目录 1.使用绝对路径 d:\Code\test\pic\pic.bmp d:\Code\test\test\xxxx\xxxx.h 此方法虽然简单,但是 如果其他人拷贝你的工程到其他机器上就可能无法运行,这个是因为你在建工程时可能把工程放在了D:盘,但是其他人可能会把工程放在其他根目录下,这样会导致找不到头文件问题。 因此我们最好设置相对路径。 对于新手,在设置绝对路径时往往会犯浑,他们不清楚这里的“相对”究竟是以什么位置为起点。其实这里的相对路径就是相当于工程文件(test.vcproj)为起点零计算出的能找到包含所需头文件(也就是找包含所需头文件的include目录)的路径。 如上的例子中要找到xxxx.h 则相对路径为 .\xxxx\xxxx.h 找到pic.bmp

Can I make a function that accepts both ram and rom pointers in Microchip C18?

不问归期 提交于 2019-12-05 18:22:47
问题 When I declare a function that accepts const char* and I pass a string literal, I get a Warning: [2066] type qualifier mismatch in assignment because string literals are rom const char* . It's the same the other way around. Though the PIC is Harvard architecture, the memory is mapped into one contiguous address space, so theoretically it should be possible to support both ram and rom pointers the same way. Probably I have to use rom pointers because they are 24 bit while ram pointers are 16

百度图片抓取

亡梦爱人 提交于 2019-12-05 16:45:57
#!/usr/bin/env python # -*- coding: utf-8 -*- # @Time : 11/23/2019 4:06 PM # @Author : DeltaT # @File : 百度图片爬虫.py """爬虫下载百度图片""" import re import os import urllib import requests search_kw = input('请输入需要下载图片种类: ') begin_page_num = 0 # 请求次数 end_page_num = 30 # 每页编号的增加值 page_num = 1 # 爬取的最大页数 all_pic_urls = list() # 保存所有url # 循环抓取每一页的图片地址 while True: if begin_page_num > page_num: break print("第{}次发送请求".format(begin_page_num + 1)) current_page_num = (begin_page_num - 1) * end_page_num # 计算页面url所需要的参数, 根据该参数拼凑url进行翻页 search_kw = urllib.parse.quote(search_kw, safe='/') url_begin = "http://image

图片处理:html文本获取图片Url,判断图片大小,存数据库

我的未来我决定 提交于 2019-12-05 12:26:03
1.从html文本获取图片Url /** * html文本中取出url链接 */ public class Url { public static void main(String[] args) { String content="<div><img src='123.jpg'/>ufiolk<img src='456.jpg'/></div>"; List<String> imgUrls = parseImg(content); for (String imgUrl : imgUrls) { System.out.println(imgUrl); } } public static List<String> parseImg(String content){ Element doc = Jsoup.parseBodyFragment(content).body(); Elements elements = doc.select("img[src]"); List<String> imgUrls = new ArrayList<>(elements == null ? 1 : elements.size()); for (Element element : elements) { String imgUrl = element.attr("src"); if

使用 Scrapy 的 ImagesPipeline 下载图片

ぐ巨炮叔叔 提交于 2019-12-05 02:48:17
下载 百度贴吧-动漫壁纸吧 所有图片 定义item Spider spider 只需要得到图片的url,必须以列表的形式给管道处理 class PictureSpiderSpider(scrapy.Spider): name = 'picture_spider' allowed_domains = ['tieba.baidu.com'] start_urls = ['https://tieba.baidu.com/f?kw=%E5%8A%A8%E6%BC%AB%E5%A3%81%E7%BA%B8'] def parse(self, response): # 贴吧中一页帖子的ID和标题 theme_urls = re.findall(r'<a rel="noreferrer" href="/p/(\d+)" title="(.*?)" target="_blank" class="j_th_tit ">', response.text, re.S) for theme in theme_urls: # 帖子的url theme_url = 'https://tieba.baidu.com/p/' + theme[0] # 进入各个帖子 yield scrapy.Request(url=theme_url, callback=self.parse_theme) # 贴吧下一页的url

Set Output Port High Low C

一笑奈何 提交于 2019-12-04 19:34:48
I'm using MPLAB to compile a program in C using the CCS compiler. I want to set an output port as high or low using defined ports. #bit portOut1 = PORTC.0 So, I want to set my portOut1 high or low. I had used 3 ways to do it, but just one had worked. But I'm not satisfied with that. 1: (Doesn't work, why?) portOut1 = output5.value; 2: (Doesn't work, why?) output_bit(portOut1,value); 3: (Obviously work) output_bit(pin_c0, value); I don't understand why the first and second way doesn't work. And I don't want to use the third because I don't know what this pin do unless I comment, and I don't

-fPIC编译选项

若如初见. 提交于 2019-12-04 18:42:12
-fPIC 作用于编译阶段,告诉编译器产生与位置无关代码(Position-Independent Code),则产生的代码中,没有绝对地址,全部使用相对地址,故而代码可以被加载器加载到内存的任意位置,都可以正确的执行。这正是共享库所要求的,共享库被加载时,在内存的位置不是固定的。 gcc -shared -fPIC -o 1.so 1.c 这里有一个-fPIC参数 PIC就是position independent code PIC使.so文件的代码段变为真正意义上的共享 如果不加-fPIC,则加载.so文件的代码段时,代码段引用的数据对象需要重定位, 重定位会修改代码段的内容,这就造成每个使用这个.so文件代码段的进程在内核里都会生成这个.so文件代码段的copy.每个copy都不一样,取决于 这个.so文件代码段和数据段内存映射的位置. 也就是 不加fPIC编译出来的so,是要再加载时根据加载到的位置再次重定位的.(因为它里面的代码并不是位置无关代码) 如果被多个应用程序共同使用,那么它们必须每个程序维护一份.so的代码副本了.(因为.so被每个程序加载的位置都不同,显然这些重定位后的代码也不同,当然不能共享) 我们总是用fPIC来生成so,也从来不用fPIC来生成.a;fPIC与动态链接可以说基本没有关系,libc.so一样可以不用fPIC编译