伯乐在线文章URL
Posted longbigbeard
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了伯乐在线文章URL相关的知识,希望对你有一定的参考价值。
- 一段代码,可以跑出所有文章的url
-
# encoding: utf-8 import requests from bs4 import BeautifulSoup base_url = ‘http://blog.jobbol session = requests.session() i=0 for i in range(559): url = base_url+str(i)+"/" # print(url) res = session.get(url=url) soup = BeautifulSoup(res.t post_nodes = soup.select(" for post_node in post_node post_url = post_node.g i+=1 print(i,post_url)