CrawlSpiders简介

2023-05-16

 转:https://www.cnblogs.com/ellisonzhang/p/11124516.html#4295547

一、CrawlSpiders类简介

通过下面的命令可以快速创建 CrawlSpider模板 的代码:

scrapy genspider -t crawl tencent tencent.com

上一个案例中,我们通过正则表达式,制作了新的url作为Request请求参数,现在我们可以换个花样...

class scrapy.spiders.CrawlSpider

它是Spider的派生类,Spider类的设计原则是只爬取start_url列表中的网页,而CrawlSpider类定义了一些规则(rule)来提供跟进link的方便的机制,从爬取的网页中获取link并继续爬取的工作更适合。

源码参考

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
class  CrawlSpider(Spider):
     rules  =  ()
     def  __init__( self * a,  * * kw):
         super (CrawlSpider,  self ).__init__( * a,  * * kw)
         self ._compile_rules()
 
     #首先调用parse()来处理start_urls中返回的response对象
     #parse()则将这些response对象传递给了_parse_response()函数处理,并设置回调函数为parse_start_url()
     #设置了跟进标志位True
     #parse将返回item和跟进了的Request对象   
     def  parse( self , response):
         return  self ._parse_response(response,  self .parse_start_url, cb_kwargs = {}, follow = True )
 
     #处理start_url中返回的response,需要重写
     def  parse_start_url( self , response):
         return  []
 
     def  process_results( self , response, results):
         return  results
 
     #从response中抽取符合任一用户定义'规则'的链接,并构造成Resquest对象返回
     def  _requests_to_follow( self , response):
         if  not  isinstance (response, HtmlResponse):
             return
         seen  =  set ()
         #抽取之内的所有链接,只要通过任意一个'规则',即表示合法
         for  n, rule  in  enumerate ( self ._rules):
             links  =  [l  for  in  rule.link_extractor.extract_links(response)  if  not  in  seen]
             #使用用户指定的process_links处理每个连接
             if  links  and  rule.process_links:
                 links  =  rule.process_links(links)
             #将链接加入seen集合,为每个链接生成Request对象,并设置回调函数为_repsonse_downloaded()
             for  link  in  links:
                 seen.add(link)
                 #构造Request对象,并将Rule规则中定义的回调函数作为这个Request对象的回调函数
                 =  Request(url = link.url, callback = self ._response_downloaded)
                 r.meta.update(rule = n, link_text = link.text)
                 #对每个Request调用process_request()函数。该函数默认为indentify,即不做任何处理,直接返回该Request.
                 yield  rule.process_request(r)
 
     #处理通过rule提取出的连接,并返回item以及request
     def  _response_downloaded( self , response):
         rule  =  self ._rules[response.meta[ 'rule' ]]
         return  self ._parse_response(response, rule.callback, rule.cb_kwargs, rule.follow)
 
     #解析response对象,会用callback解析处理他,并返回request或Item对象
     def  _parse_response( self , response, callback, cb_kwargs, follow = True ):
         #首先判断是否设置了回调函数。(该回调函数可能是rule中的解析函数,也可能是 parse_start_url函数)
         #如果设置了回调函数(parse_start_url()),那么首先用parse_start_url()处理response对象,
         #然后再交给process_results处理。返回cb_res的一个列表
         if  callback:
             #如果是parse调用的,则会解析成Request对象
             #如果是rule callback,则会解析成Item
             cb_res  =  callback(response,  * * cb_kwargs)  or  ()
             cb_res  =  self .process_results(response, cb_res)
             for  requests_or_item  in  iterate_spider_output(cb_res):
                 yield  requests_or_item
 
         #如果需要跟进,那么使用定义的Rule规则提取并返回这些Request对象
         if  follow  and  self ._follow_links:
             #返回每个Request对象
             for  request_or_item  in  self ._requests_to_follow(response):
                 yield  request_or_item
 
     def  _compile_rules( self ):
         def  get_method(method):
             if  callable (method):
                 return  method
             elif  isinstance (method,  basestring ):
                 return  getattr ( self , method,  None )
 
         self ._rules  =  [copy.copy(r)  for  in  self .rules]
         for  rule  in  self ._rules:
             rule.callback  =  get_method(rule.callback)
             rule.process_links  =  get_method(rule.process_links)
             rule.process_request  =  get_method(rule.process_request)
 
     def  set_crawler( self , crawler):
         super (CrawlSpider,  self ).set_crawler(crawler)
         self ._follow_links  =  crawler.settings.getbool( 'CRAWLSPIDER_FOLLOW_LINKS' True )

二、LinkExtractors

Link Extractors 的目的很简单: 提取链接

每个LinkExtractor有唯一的公共方法是 extract_links(),它接收一个 Response 对象,并返回一个 scrapy.link.Link 对象。

Link Extractors要实例化一次,并且 extract_links 方法会根据不同的 response 调用多次提取链接。

主要参数

1
2
3
4
5
6
7
8
9
10
11
12
13
class  scrapy.linkextractors.LinkExtractor(
     allow  =  (),      # 满足括号中“正则表达式”的值会被提取,如果为空,则全部匹配
     deny  =  (),       # 与这个正则表达式(或正则表达式列表)不匹配的URL一定不提取
     allow_domains  =  (),      # 会被提取的链接的domains
     deny_domains  =  (),       # 一定不会被提取链接的domains
     deny_extensions  =  None ,
     restrict_xpaths  =  (),    # 使用xpath表达式,和allow共同作用过滤链接(一般只用allow就行了)
     tags  =  ( 'a' , 'area' ),
     attrs  =  ( 'href' ),
     canonicalize  =  True ,
     unique  =  True ,
     process_value  =  None
)

三、LinkExtractors

在rules中包含一个或多个Rule对象,每个Rule对爬取网站的动作定义了特定操作。如果多个rule匹配了相同的链接,则根据规则在本集合中被定义的顺序,第一个会被使用。

主要参数

1
2
3
4
5
6
7
8
class  scrapy.spiders.Rule(
         link_extractor,
         callback  =  None ,
         cb_kwargs  =  None ,
         follow  =  None ,
         process_links  =  None ,
         process_request  =  None
)
  • link_extractor:是一个Link Extractor对象,用于定义需要提取的链接。

  • callback: 从link_extractor中每获取到链接时,参数所指定的值作为回调函数,该回调函数接受一个response作为其第一个参数。

    注意:当编写爬虫规则时,避免使用parse作为回调函数。由于CrawlSpider使用parse方法来实现其逻辑,如果覆盖了 parse方法,crawl spider将会运行失败。

  • follow:是一个布尔(boolean)值,指定了根据该规则从response提取的链接是否需要跟进。 如果callback为None,follow 默认设置为True ,否则默认为False。

  • process_links:指定该spider中哪个的函数将会被调用,从link_extractor中获取到链接列表时将会调用该函数。该方法主要用来过滤。

  • process_request:指定该spider中哪个的函数将会被调用, 该规则提取到每个request时都会调用该函数。 (用来过滤request)

小Tips

1
由于CrawlSpider使用parse方法来实现其逻辑,如果覆盖了 parse方法,crawl spider将会运行失败。

四、Logging

Scrapy提供了log功能,可以通过 logging 模块使用。

可以修改配置文件settings.py,任意位置添加下面两行。

LOG_FILE = "TencentSpider.log"
LOG_LEVEL = "INFO"

Log levels

  • Scrapy提供5层logging级别:

  • CRITICAL - 严重错误(critical)

  • ERROR - 一般错误(regular errors)
  • WARNING - 警告信息(warning messages)
  • INFO - 一般信息(informational messages)
  • DEBUG - 调试信息(debugging messages)

logging设置

通过在setting.py中进行以下设置可以被用来配置logging:

  1. LOG_ENABLED 默认: True,启用logging
  2. LOG_ENCODING 默认: 'utf-8',logging使用的编码
  3. LOG_FILE 默认: None,在当前目录里创建logging输出文件的文件名
  4. LOG_LEVEL 默认: 'DEBUG',log的最低级别
  5. LOG_STDOUT 默认: False 如果为 True,进程所有的标准输出(及错误)将会被重定向到log中。例如,执行 print "hello" ,其将会在Scrapy log中显示。

 示例1、使用CrawlSpider爬取腾讯招聘网站

爬虫模块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# -*- coding: utf-8 -*-
import  scrapy
from  scrapy.linkextractors  import  LinkExtractor  # 导入链接规则匹配类,用来提取符合规则的连接
from  scrapy.spiders  import  CrawlSpider, Rule     # 导入CrawlSpider类和Rule
from  day_31.TencentCrawlSpider.TencentCrawlSpider.items  import  TencentcrawlspiderItem
 
 
class  TencentSpider(CrawlSpider):
     name  =  'tencent'
     allowed_domains  =  [ 'tencent.com' ]
     start_urls  =  [ 'http://hr.tencent.com/position.php?&start=0' ]
 
     rules  =  (
         Rule(LinkExtractor(allow = r 'position\.php\?&start=\d+#a' ), callback = 'parse_item' , follow = True ),
         # Response里链接的提取规则,返回的符合匹配规则的链接匹配对象的列表
         # 获取这个列表里的链接,依次发送请求,并且继续跟进,调用指定回调函数处理
         # 前面加r表示将正则表达式编译成一个规则的对象
     )
 
     # 指定的回调函数
     def  parse_item( self , response):
         for  in  response.xpath( '//tr[@class="even"] | //tr[@class="odd"]' ):
             item  =  TencentcrawlspiderItem()
             item[ 'name' =  i.xpath( ".//a/text()" ).extract()[ 0 ]
             item[ 'link' =  i.xpath( ".//a/@href" ).extract()[ 0 ]
             item[ 'type' =  i.xpath( "./td[2]/text()" ).extract()[ 0 ]
             item[ 'number' =  i.xpath( ".//td[3]/text()" ).extract()[ 0 ]
             item[ 'place' =  i.xpath( ".//td[4]/text()" ).extract()[ 0 ]
             item[ 'rtime' =  i.xpath( ".//td[5]/text()" ).extract()[ 0 ]
             yield  item

管道模块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# -*- coding: utf-8 -*-
 
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import  json
 
class  TencentcrawlspiderPipeline( object ):
     def  __init__( self ):
         self . file  =  open ( 'tencent-job.json' , 'wb' )
 
     def  process_item( self , item, spider):
         text  =  json.dumps( dict (item),ensure_ascii = False ) + '\n'
         self . file .write(text.encode( 'utf-8' ))
         return  item
 
     def  close_spider( self , spider):
         self . file .close()

小Tips

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
1 、python 爬虫爬取内容时, \xa0 、 \u3000 的含义
 
\xa0 是不间断空白符  
 
我们通常所用的空格是 \x20 ,是在标准ASCII可见字符  0x20 ~ 0x7e  范围内。
而 \xa0 属于 latin1 (ISO / IEC_8859 - 1 )中的扩展字符集字符,代表空白符nbsp(non - breaking space)。
latin1 字符集向下兼容 ASCII (  0x20 ~ 0x7e  )。通常我们见到的字符多数是 latin1 的,比如在 MySQL 数据库中。
 
\u3000 是全角的空白符
 
根据 Unicode 编码标准及其基本多语言面的定义, \u3000 属于CJK字符的CJK标点符号区块内,是空白字符之一。它的名字是 Ideographic Space ,有人译作表意字空格、象形字空格等。顾名思义,就是全角的 CJK 空格。它跟 nbsp 不一样,是可以被换行间断的。常用于制造缩进, wiki 还说用于抬头,但没见过。
 
2 、response.url     # 获取当前页面url
 
3 、在allow里面的正则匹配,有特殊字符( '.' , '?' )要加转义字符 '\'
page_lx  =  LinkExtractor(allow = ( 'position\.php\?&start=\d+' ))
 
4 、字符串去空格  str .strip()

示例二:爬取网页里面的信息(东莞)

爬虫模块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
# -*- coding: utf-8 -*-
import  scrapy
from  scrapy.linkextractors  import  LinkExtractor
from  scrapy.spiders  import  CrawlSpider, Rule
from  newdongguan.items  import  NewdongguanItem
 
 
class  DongdongSpider(CrawlSpider):
     name  =  'dongdong'
     allowed_domains  =  [ 'wz.sun0769.com' ]
     start_urls  =  [ 'http://wz.sun0769.com/index.php/question/questionType?type=4&page=' ]
 
     # 每一页的匹配规则
     pagelink  =  LinkExtractor(allow = ( "type=4" ))
     # 每一页里的每个帖子的匹配规则
     contentlink  =  LinkExtractor(allow = (r "/html/question/\d+/\d+.shtml" ))
 
     rules  =  (
         Rule(pagelink),
         Rule(contentlink, callback  =  "parse_item" ,follow = False )
     )
 
     def  parse_item( self , response):
         item  =  NewdongguanItem()
         # 标题
         item[ 'title' =  response.xpath( '//div[contains(@class, "pagecenter p3")]//strong/text()' ).extract()[ 0 ]
         # 编号
         item[ 'number' =  item[ 'title' ].split( ' ' )[ - 1 ].split( ":" )[ - 1 ]
         # 内容,先使用有图片情况下的匹配规则,如果有内容,返回所有内容的列表集合
         content  =  response.xpath( '//div[@class="contentext"]/text()' ).extract()
         # 如果没有内容,则返回空列表,则使用无图片情况下的匹配规则
         if  len (content)  = =  0 :
             content  =  response.xpath( '//div[@class="c1 text14_2"]/text()' ).extract()
             item[ 'content' =  "".join(content).strip()
         else :
             item[ 'content' =  "".join(content).strip()
         # 链接
         item[ 'url' =  response.url
 
         yield  item

管道模块

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# -*- coding: utf-8 -*-
 
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: http://doc.scrapy.org/en/latest/topics/item-pipeline.html
import  json
 
class  DongguancrawlspiderPipeline( object ):
     def  __init__( self ):
         self . file  =  open ( 'dongguan.json' , 'wb' )
 
     def  process_item( self , item, spider):
         text  =  json.dumps( dict (item),ensure_ascii = False ) + '\n'
         self . file .write(text.encode( 'utf-8' ))
         return  item
 
     def  close_spider( self ,spider):
         self . file .close()

1、提取出来的链接可能被篡改,所以我们可以通过process_link来修改url(一般不会遇到)

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import  scrapy
from  scrapy.linkextractors  import  LinkExtractor
from  scrapy.spiders  import  CrawlSpider, Rule
from  newdongguan.items  import  NewdongguanItem
 
 
class  DongdongSpider(CrawlSpider):
     name  =  'dongdong'
     allowed_domains  =  [ 'wz.sun0769.com' ]
     start_urls  =  [ 'http://wz.sun0769.com/index.php/question/questionType?type=4&page=' ]
 
     # 每一页的匹配规则
     pagelink  =  LinkExtractor(allow = ( "type=4" ))
     # 每一页里的每个帖子的匹配规则
     contentlink  =  LinkExtractor(allow = (r "/html/question/\d+/\d+.shtml" ))
 
     rules  =  (
         # 本案例的url被web服务器篡改,需要调用process_links来处理提取出来的url
         Rule(pagelink, process_links  =  "deal_links" ),
         Rule(contentlink, callback  =  "parse_item" )
     )
 
     # links 是当前response里提取出来的链接列表
     def  deal_links( self , links):
         for  each  in  links:
             each.url  =  each.url.replace( "?" , "&" ).replace( "Type&" , "Type?" )
         return  links
 
     def  parse_item( self , response):
         ...

2、修改成spider类

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# -*- coding: utf-8 -*-
import  scrapy
from  newdongguan.items  import  NewdongguanItem
 
 
class  DongdongSpider(scrapy.Spider):
     name  =  'xixi'
     allowed_domains  =  [ 'wz.sun0769.com' ]
     url  =  'http://wz.sun0769.com/index.php/question/questionType?type=4&page='
     offset  =  0
     start_urls  =  [url  +  str (offset)]
 
 
     def  parse( self , response):
         # 每一页里的所有帖子的链接集合
         links  =  response.xpath( '//div[@class="greyframe"]/table//td/a[@class="news14"]/@href' ).extract()
         # 迭代取出集合里的链接
         for  link  in  links:
             # 提取列表里每个帖子的链接,发送请求放到请求队列里,并调用self.parse_item来处理
             yield  scrapy.Request(link, callback  =  self .parse_item)
 
         # 页面终止条件成立前,会一直自增offset的值,并发送新的页面请求,调用parse方法处理
         if  self .offset < =  71160 :
             self .offset  + =  30
             # 发送请求放到请求队列里,调用self.parse处理response
             yield  scrapy.Request( self .url  +  str ( self .offset), callback  =  self .parse)
 
     # 处理每个帖子的response内容
     def  parse_item( self , response):
         item  =  NewdongguanItem()
         # 标题
         item[ 'title' =  response.xpath( '//div[contains(@class, "pagecenter p3")]//strong/text()' ).extract()[ 0 ]
         # 编号
         item[ 'number' =  item[ 'title' ].split( ' ' )[ - 1 ].split( ":" )[ - 1 ]
         # 内容,先使用有图片情况下的匹配规则,如果有内容,返回所有内容的列表集合
         content  =  response.xpath( '//div[@class="contentext"]/text()' ).extract()
         # 如果没有内容,则返回空列表,则使用无图片情况下的匹配规则
         if  len (content)  = =  0 :
             content  =  response.xpath( '//div[@class="c1 text14_2"]/text()' ).extract()
             item[ 'content' =  "".join(content).strip()
         else :
             item[ 'content' =  "".join(content).strip()
         # 链接
         item[ 'url' =  response.url
 
         # 交给管道
         yield  item

小Tips:

1
2
3
4
5
6
7
8
9
10
list  =  [a,b,c]
string  =  "123" .join( list )
print (string)
>> a  123b  123c
 
string.replace( "\xa0" ,"")    # 将空格换成空
 
string.strip()       # 去首尾的空格
string.lstrip()      # 去左边(前面)的空格
string.rstrip()      # 去右边(后面)的空格

转载于:https://www.cnblogs.com/kenD/p/11584989.html

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

CrawlSpiders简介 的相关文章

  • c++11 条款21:尽量使用std::make_unique和std::make_shared而不直接使用new

    条款21 xff1a 尽量使用std make unique和std make shared而不直接使用new 让我们从对齐std make unique 和 std make shared这两块开始 std make shared是c 4
  • 快递 10 年,逆袭为王

    2009 2018 xff0c 双十一 全民狂欢已走过十载 xff0c 网购成为了国民消费不可或缺的重要组成 xff0c 并带动了上下游众多产业的狂飙发展 xff0c 这其中 xff0c 以民营快递最为突出 金风玉露一相逢 xff0c 便胜
  • BPDU报文(RSTP)

    与STP 的BPDU报文格式相同 xff0c 就是在flags字段报文中间几位得到应用 主要原理 xff1a 利用flages位中的Proposal与Agreement来进行协商 xff0c 从而快速从 discarding 转成 forw
  • 怎么在一堆身份证中筛选出大于18岁的?

    最近一朋友找我帮个忙 xff0c 让我在N多身份证中找到18岁以上的人 我还想着用SQL查询来弄 xff0c 谁让是干IT的呢 xff0c 没想到被我一个朋友用excel瞬间解决 学习新的东西是多么的重要啊 其实就是利用了excel中的MI
  • 微信小程序我的界面

    前言 感谢 承蒙关照 微信小程序我的界面 界面效果 界面结构 小程序代码 我们先看me json代码 34 navigationBarTitleText 34 34 个人中心 34 me wxml代码 lt view class 61 34
  • __sync_fetch_and_add

    最近在公司离职的前辈写的代码哪里看到了 sync fetch and add这个东东 比较好奇 找些资料学习学习 http www lxway com 4091061956 htm http www cnblogs com FrankTan
  • 2.5年, 从0到阿里

    从来没有想到自己的求职之路会这么顺利 第一次投阿里就拿到了offer 以前一直都是做好被刷的准备的 3月31号晚上收到了来自阿里的正式offer 签下录取意向书 粗略算了一下 从2012年9月份正式入学进入计算机系到2015年3月签下阿里o
  • Cmake知识整理

    目录 CMake官方文档 CMake特点CMake命令find package二进制目标构建选项CMake文本内置命令CMake工程内置命令CMake toolchainsCMake变量 信息描述部分CMake变量 动作行为部分CMake变
  • closstol-ng制作交叉编译器

    crosstool ng制作交叉编译器 本文档基于凌云物网智科实验室文档制作 1 xff0c gt gt mkdir crosstool gt gt cd crosstool gt gt wget http crosstoolng org
  • How to resolve `unmet dependencies, Depends: nodejs but it is not going to be installed` npm

    为了安装Node Red xff0c 将ubuntu 18 04 的node js v8 升到 node js v10 Supported Node versions https nodered org docs faq node vers
  • Android开源项目及库搜集

    TimLiu Android 自己总结的Android开源项目及库 github排名 https github com trending github搜索 xff1a https github com search 目录 UI 卫星菜单节选
  • 深入Linux内核架构——简介与概述

    一 内核的任务 纯技术层面上 xff0c 内核是硬件与软件的之间的一个中间层 作用是将应用程序的请求传递给硬件 xff0c 并充当底层驱动程序 xff0c 对系统中的各种设备和组件进行寻址 从应用程序视角上看 xff0c 内核可以被认为是一
  • Flask快速入门(4) — CBV写法与解析

    目录 方式一 xff1a 继承View as view 源码分析方式二 xff1a 继承MethodView 方式一 xff1a 继承View code from flask import Flask views app 61 Flask
  • Flask快速入门(6) — 常见的请求与响应参数

    Flask快速入门 6 常见的请求与响应参数 code from flask import Flask from flask import request from flask import render template from fla
  • Flask快速入门(5) — 模板渲染

    Flask快速入门 5 模板渲染 视图函数 code from flask import Flask request render template Markup app 61 Flask name 64 app route 39 39 e
  • [转帖]windows10,business版和consumer版本区别

    windows10 business版和consumer版本区别 时间 2018 07 08 10 50 来源 原创 作者 5分享 点击 7113 次 windows10系统 xff08 1803 xff09 business editio
  • \0 的ASCII码值是多少

    0 的ASCII码值是多少 include lt iostream gt using namespace std void main char c 61 39 0 39 cout lt lt int c lt lt endl 输出是0 xf
  • python练习:编写一个程序,要求用户输入10个整数,然后输出其中最大的奇数,如果用户没有输入奇数,则输出一个消息进行说明。...

    python练习 xff1a 编写一个程序 xff0c 要求用户输入10个整数 xff0c 然后输出其中最大的奇数 xff0c 如果用户没有输入奇数 xff0c 则输出一个消息进行说明 重难点 xff1a 通过input函数输入的行消息为字
  • thenApply()和thenCompose()的区别

    thenApply 和thenCompose xff08 xff09 的区别 xff1a thenapply xff08 xff09 是返回的是非CompletableFuture类型 xff1a 它的功能相当于将CompletableFu

随机推荐

  • 超宽带(UWB)无线通信技术介绍

    http hi baidu com hieda blog item 1cb9c81122eaed7acb80c42e html 一 超宽带无线通信技术 UWB 简介 二 超宽带无线通信技术概述 作者 李唐 刘亚峰 三 超宽带 UWB 无线通
  • TTGO T-Watch-2020 编程系列(二) 开发环境的搭建Windows

    现阶段只介绍windows下的环境搭建 xff0c Linux和Mac的环境类似 这里只介绍Arduino开发 xff0c 还可以用其他的工具 visual studio code 43 PlatformIO或者micropython等 x
  • Bag-of-words model

    Bag of words model BoW model 最早出现在NLP和IR领域 该模型忽略掉文本的语法和语序 用一组无序的单词 words 来表达一段文字或一个文档 近年来 BoW模型被广泛应用于计算机视觉中 与应用于文本的BoW类比
  • 链式队列小结

    1 队列的特性是先进先出 xff1b 最小单元是一个节点 包含了datatype和next xff0c 其中datatype是可以自定义的结构体 xff0c 包含了多种类型的数据 2 对队列有队尾指针和队头指针进行封装 后面的操作是对他进行
  • linux 学习笔记 我 整理了好久

    printenv 查看环境 hash 查看缓存命令 clock hwclock date 查看时间 help 43 command 获得帮助 command help man command 用户命令 bin usr bin usr loc
  • .net 打开服务器文档,net 网络

    net Socket 类 新增于 v0 3 4 此类是 TCP 套接字或流式 IPC 端点 在 Windows 上使用命名管道 xff0c 否则使用 Unix 域套接字 的抽象 它也是 EventEmitter net Socket 可以由
  • 工控机的io开发_C#调用工控机dll文件,实现对IO的控制

    本文旨在记录 xff0c C 通过调用外部DLL文件实现对Nuvo3120工控机IO口的控制 前期 xff0c 了解了C 43 43 中 c h lib文件的区别 xff0c 以及用这些文件生成DLL的方法 xff0c 后面通过厂家直接找到
  • 姿态估计中的雅可比求导

    问题描述 姿态估计是SLAM中的一个基础问题 基于重投影误差的问题描述一般为求解下列的优化问题 min mathbf T mathbf f quad mathbf f 61 mathbf e T mathbf e 61 parallel p
  • linux安装杀毒软件

    https www cnblogs com bingo1024 p 9018212 html 转载于 https www cnblogs com majianyu p 10490920 html
  • Ubantu下VSCode安装及使用makefile链接调试

    一 安装VSCode 1 通过官方PPA安装Ubuntu make sudo add apt repository ppa ubuntu desktop ubuntu make sudo apt get update sudo apt ge
  • Git和SourceTree配合使用

    Git介绍 git是当今最强大的本地的分布式代码版本管理工具 git的核心概念与操作 xff1a 开发环境 xff0c 本地仓库 xff0c 远程仓库 他们的关系如下图 xff1a 与CVS及SVN的比较 xff1a CVS及SVN都是集中
  • 安装vmware tools 后也不能和主机之间复制、粘贴内容、拖拽文件的解决方案

    1 先尝试重新安装vmware tools 2 换最新版本的vmware player 3 运行以下命令 sudo apt get autoremove open vm tools sudo apt get install open vm
  • linux 应用网络连接失败的原因,PuTTY网络错误:软件导致连接中止

    解决PuTTY网络错误 Software caused connection abort 阅读有关该错误的PuTTY怎么说 这是Windows网络代码由于某种原因而终止已建立的连接时所产生的一般错误 例如 xff0c 如果将网络电缆从连接以
  • 智能革命之读书笔记

    我在孩童时代听说机器人时内心觉得那是距离我所生活的时代遥不可及的事物 xff0c 大学时听说人工智能 xff0c 一直对它敬而远之 xff0c 甚至对它有一种畏惧情绪 xff0c 心里一直有种担忧 xff0c 人工智能高度发展 xff0c
  • PX4 FMU [5] Loop

    PX4 FMU 5 Loop PX4 FMU 5 Loop 转载请注明出处 更多笔记请访问我的博客 xff1a merafour blog 163 com 201
  • 简历中工作经验应该如何写

    许多学习软件开发的学员不知道如何在个人简历中如何填写 项目经验 或 项目描述 xff0c 最近接触的一些学习Java的学生在简历中 xff0c 往往项目经验及描述都只能寥寥几笔完事 xff0c 这样的简历肯定是不吸引招聘企业HR的 那么软件
  • 计算机关机界面卡住,电脑关机时卡在关机界面的解决方法

    电脑关机时卡在关机界面的解决方法 发布时间 xff1a 2012 11 19 12 13 04 作者 xff1a 佚名 我要评论 笔记本或台式电脑的XP系统在关机的时候 xff0c 提示正在关闭或正在注销 xff0c 却一直无法正常关闭电脑
  • vue 指定index.html,在vue中,v-for的索引index在html中的使用方法

    在vue中 v for的索引index在html中的使用方法 如下所示 xff1a 以上这篇在vue中 v for的索引index在html中的使用方法就是小编分享给大家的全部内容了 xff0c 希望能给大家一个参考 xff0c 也希望大家
  • windows10 ubuntu子系统 WSL文件位置

    windows10 的linux子系统 xff08 windows subsystem for linux WSL 文件位置 以我的系统为例 xff0c WSL的root目录对应windows的 xff1a C Users xiaoPeng
  • CrawlSpiders简介

    转 xff1a https www cnblogs com ellisonzhang p 11124516 html 4295547 一 CrawlSpiders类简介 通过下面的命令可以快速创建 CrawlSpider模板 的代码 xff