搜索
首页
|
论坛
|
消息
宁波妈妈网
>
python
主题:
xpath抓取的值有空格换行符等问题
回帖:#每爬完一个网页会回调parse方法
def parse(self, response):
hx=response.xpath('//td[@class="zwmc"]/div/a')
#选取href里有"450836..."
print('_________________________')
print(hx[0].select("@href").extract()) # 取长度
print(hx[0].select("text()").extract()) # 取长度
北斗星
回帖于2019-03-28 15:39
下一楼›
:import scrapy
class QuoteSpider(scrapy.Spider):
name = 'quote'
start_u ..
(
北斗星
)
‹上一楼
:https://blog.csdn.net/lishk314/article/details/83539622
def parse(self, response) ..
(
北斗星
)
查看全部回帖(10)
«返回主帖