2017-10-12 59 views
1
<div class="breadcrumbs pt10 pb10"> 
<a>Location :</a> 
"National Harbor     , 
      Maryland" 
<br> 
<a href="#" class="type">Venue : </a> 
"Gaylord National Resort & Convention Center " 
</div> 

如何获取文本国家海港马里兰州盖洛德国家度假村&会议中心从上面在python使用scrapy?我的应用这个代码..“response.selector.xpath('// div [@ class =”breadcrumbs pt10 pb10“]/a/text()')。extract()”....但o/p我越来越喜欢这个......“[u'Location:',u'Venue:']”。任何人都可以帮忙吗?感谢提前!如何从'a'标签的外部获取文本并使用scrapy在python中列出它们?

回答

0

1)您可以直接使用response.xpath

2)//div[@class='breadcrumbs pt10 pb10']/text()将帮助

相关问题