例某网站的URL集是这样的

https://www.555zw.com/book/40/40934/10334793.html

https://www.555zw.com/book/40/40934/10334794.html

https://www.555zw.com/book/40/40934/10334795.html

https://www.555zw.com/book/40/40934/10334796.html

https://www.555zw.com/book/40/40934/10334797.html

...

通过列表推导式,构造URL列表

#[构造 赋值]

#使用

urls=['https://www.555zw.com/book/40/40934/1033479{}.html'.format(number)] for number in range (3,8)]

for url in urls:

  print(url)

 

相关文章:

  • 2021-08-18
  • 2022-12-23
  • 2021-08-27
  • 2022-01-19
  • 2021-05-06
  • 2022-12-23
  • 2021-08-03
  • 2022-01-04
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-01-10
  • 2021-07-03
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案