python-3.x - python webscraping与BeautifulSoup问题
问题描述
我试图从https://www.nascar.com/stats/2021/1/box-score刮掉盒子得分表
如果有人可以看一下并指出我正确的方向,我的代码将无法正常工作。
`import requests
from bs4 import BeautifulSoup
import pandas as pd
import requests
from bs4 import BeautifulSoup
import pandas as pd
url = ('https://www.nascar.com/stats/2021/1/box-score')
response = requests.get(url, headers = headers)
response.content
soup = BeautifulSoup(response.content, 'html.parser')
stats = soup.find_all('table', class_ = "stats-box-score-table-driver")
stats
for row in stats.find_all('tr'):
for cell in row.find_all('td'):
print(cell.text)
解决方案
推荐阅读
- reactjs - 收到来自 firebase 云消息传递的消息后调度操作
- python - 内核似乎已经死了。它将自动重新启动。在 MacBook Pro M1 上
- c++ - 指向未知模板类型的全局外部指针
- raspberry-pi - 具有 php mail() 支持的灯堆栈 Web 服务器的免费 Web 托管
- zsh - zsh 中的 csplit:基于模式拆分文件
- css - 如何使用 Material UI/Grid 修复此 AccordionDetails 的定位
- powershell - 过滤 PowerShell 命令输出
- javascript - 如何从项目数组中删除/删除项目?
- c - C中的无符号字符未按预期工作
- python-3.x - 日志记录模块python中的不一致