2017-10-12 26 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()將幫助

相關問題