mask_x = ['11', '12', 13']

方法1:for循环遍历

mask_x = [int(x) for x in mask_x]

方法2:map迭代

mask_x = list(map(int, mask_x))

 可能出现的错误:

Scrapy运行错误:ValueError: invalid literal for int() with base 10:

原因:list中出现了空格或者非数字的字符

解决:去除掉非法字符即可

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-30
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-11-03
  • 2021-06-11
  • 2022-12-23
  • 2022-01-12
  • 2021-12-23
  • 2022-03-07
相关资源
相似解决方案