![](https://lstatic.shangxueba.com/sxbzda/h5/images/m_q_title.png)
HTML标签<title>与之间</title>显示的是()
A.关键词
B.网页描述
C.网页标题
D.以上都不是
![](https://lstatic.shangxueba.com/sxbzda/h5/images/tips_org.png)
A.关键词
B.网页描述
C.网页标题
D.以上都不是
第1题
from scrapy.selector import Selector htmlText=''' <html> <body> <bookstore> <title>books</title> <book> <title>Novel</title> <title lang="eng">Harry Potter</title> <price>29.99</price> </book> <book> <title>TextBook</title> <title lang="eng">Learning XML</title> <price>39.95</price> </book> ''' selector=Selector(text=htmlText) _____________________________________ for e in s: print(e) 程序结果: <selector xpath="//book/title" data="<title>Novel</title>"> <selector xpath="//book/title" data="<title lang=" eng">Harry Potter</selector></selector></bookstore></body></html></title>"> <selector xpath="//book/title" data="<title>TextBook</title>"> <selector xpath="//book/title" data="<title lang=" eng">Learning XML</selector></selector></book></bookstore></body></html></title>">
A、s=selector.xpath("/book").xpath("./title")
B、s=selector.xpath("//book").xpath("./title")
C、s=selector.xpath("//book").xpath("/title")
D、s=selector.xpath("/book").xpath("/title")
第2题
A.HTML标签分为“双标签”与“单标签”
B.标签也称为HTML标签或HTML元素
C.注释标签的内容会显示在浏览器窗口中
D.HTML标签分为“体标签”与“空标签”
第3题
from scrapy.selector import Selector htmlText=''' <bookstore> <book> <title lang="eng">Harry Potter</title> <price> 29.99 </price> </book> <book> <title lang="eng">Learning XML</title> <price> 39.95 </price> </book> </bookstore> ''' selector=Selector(text=htmlText) print(type(selector)); print(selector) _______________ print(type(s)) print(s) 查找所有的 <title>
A、s=selector.xpath("title")
B、s=selector.xpath("//title")
C、s=selector.xpath("/title")
D、s=selector.xpath("///title")
参考答案:<span style="color:rgb(255, 0, 0)">B</span>
4、from scrapy.selector import Selector htmlText=''' <html> <body> <bookstore> <title>books</title> <book> <title>Novel</title> <title lang="eng">Harry Potter</title> <price> 29.99 </price> </book> <book> <title>TextBook</title> <title lang="eng">Learning XML</title> <price> 39.95 </price> </book> ''' selector=Selector(text=htmlText) _____________________________________ for e in s: print(e) 程序结果: <selector xpath="//book/title" data="<title>Novel</title>"> <selector xpath="//book/title" data="<title lang=" eng">Harry Potter"> <selector xpath="//book/title" data="<title>TextBook</title>"> <selector xpath="//book/title" data="<title lang=" eng">Learning XML">
A、s=selector.xpath("/book").xpath("./title")
B、s=selector.xpath("//book").xpath("./title")
C、s=selector.xpath("//book").xpath("/title")
D、s=selector.xpath("/book").xpath("/title")
第4题
A.HTML标记都必须配对使用。
B.在<title>和</title>标签之间的是头信息
C.HTML标签是大小写无关的.<b>跟<B>表示的意思是一样的
D.在<u>和</u>标签之间的文本会以加粗字体显示
第5题
A.不同标签之间可以交叉,也可以嵌套
B. 标签中要么全用小写字符,要么全用大写字符
C. HTML标签控制文档的显示格式
D. 属性可加于起始标签或者结束标签中
第6题
A.属性可加于起始标签或者结束标签中
B. 标签中要么全用小写字符,要么全用大写字符
C. HTML标签控制文档的显示格式
D. 不同标签之间可以交叉,也可以嵌套
第7题
A、HTML标记都必须配对使用
B、在title和/title标签之间的是头信息
C、HTML标签是大小写无关的,b跟B表示的意思是一样的
D、在u和/u标签之间的文本会以加粗字体显示
为了保护您的账号安全,请在“上学吧”公众号进行验证,点击“官网服务”-“账号验证”后输入验证码“”完成验证,验证成功后方可继续查看答案!