网络爬虫-python
全国大学排名网络爬虫
先网络中输入全国大学排名,可以查看他的源代码,如下图,大学的信息包含在<tbody>标签下,通过使用.children()来遍历每个大学,具体代码如下:
###实例:中国大学排名
import bs4
import requests
from bs4 import BeautifulSoup
def getHTMLText(url):
try:
r = requests.get(url,timeout = 30)
r.raise_f
原创
2020-11-15 16:56:20 ·
81 阅读 ·
0 评论