# for url in urls:
# url = response.urljoin(url)
# print(url)
urls = map(lambda url:response.urljoin(url),urls)
print(urls)

在这里要情调的是map函数运行完之后会生成一个map对象(<map object at 0x00000000052779E8>),所以还需要转换一下,即:
urls = list(map(lambda url:response.urljoin(url),urls))
print(url)
这是打印出来的就是一个list对象了。




list(map(lambda x:re.sub(r'\s','',x),house_type_list))
将一个列表(
house_type_list
)遍历,删除掉空格。

相关文章:

  • 2022-12-23
  • 2021-05-18
  • 2021-12-18
  • 2021-12-18
  • 2021-12-18
  • 2021-06-21
  • 2022-12-23
猜你喜欢
  • 2021-11-30
  • 2021-11-22
  • 2021-11-30
  • 2021-11-30
  • 2021-11-30
  • 2021-12-18
  • 2021-12-18
相关资源
相似解决方案