问题描述
我是网络爬虫的新手,并且想从Spotrac刮刮一位大学项目的球员姓名和薪水。 到目前为止,我所做的如下。
import requests
from bs4 import BeautifulSoup
URL = 'https://www.spotrac.com/nfl/rankings/'
reqs = requests.get(URL)
soup = BeautifulSoup(reqs.text,'lxml')
print("List of all the h1,h2,h3 :")
for my_tag in soup.find_all(class_="team-name"):
print(my_tag.text)
for my_tag in soup.find_all(class_="info"):
print(my_tag.text)
此输出仅100个名称,但是页面有1000个元素。是这种情况吗?
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)