black

登录

单项选择题

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="&lt;title&gt;Novel&lt;/title&gt;"> <selector xpath="//book/title" data="&lt;title lang=" eng">Harry Potter</selector></selector></bookstore></body></html></title>"> <selector xpath="//book/title" data="&lt;title&gt;TextBook&lt;/title&gt;"> <selector xpath="//book/title" data="&lt;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")

A.selector
B.99</price>
C.95</price>
D.xpath("/book").xpath("./title")
E.xpath("//book").xpath("./title")
F.xpath("//book").xpath("/title")
G.xpath("/book").xpath("/title")
相关考题

单项选择题 某社会工作机构有一个项目是针对“印象家园”小区提供亲子服务,但社区对这些社会工作者们都不是很熟悉。为了让社区居民能够了解和认识他们,社会工作者们参与到社区每到节假日自行举办的传统活动中,这主要体现了社会工作者们通过()让社区认识自己。

单项选择题 from scrapy.selector import Selector htmlText=""" <bookstore> <book id="b1"> <title lang="english">Harry Potter</title> <price>29.99</price> </book> </bookstore> """ selector=Selector(text=htmlText) _________________________ print(s) print(s.extract()) for e in s: print(e.extract()) 程序结果: [<selector xpath="//book/title/text()" data="arry ">, <selector xpath="//book/title/text()" data="otter">] ["arry ", "otter"] arry otterA、s=selector.xpath("//book/title/text()")B、s=selector.xpath("/book/title/text()")C、s=selector.xpath("//book/title/text")D、s=selector.xpath("/book/title/text")

单项选择题 《孙子兵法》是()家的代表作

All Rights Reserved 版权所有©PP题库网库(pptiku.com)

备案号:湘ICP备14005140号-5

经营许可证号:湘B2-20140064