python - 我的代码(Python)试图从某些区域中选择一堆 CSS
问题描述
我的代码试图从某些区域中选择一堆 CSS,但是我似乎无法弄清楚要选择什么。我正在使用 Python、bs4、requests 和 pandas。这就是我的代码是 atm。
from bs4 import BeautifulSoup
import requests as re
import pandas as pd
url = 'https://forum.sa-mp.com/search.php?searchid=22924663'
response = re.get(url)
soup = BeautifulSoup(response.content, "lxml")
body = soup.select_one('#inlinemodform > .alt1').text
with open('always.txt', 'w') as f:
f.write(body + "\n")
print(body)
这就是我要选择的。 链接到图片
该网页的链接是https://forum.sa-mp.com/search.php?searchid=22924663以防您还没有想到。我怀疑您是否能够在不创建帐户的情况下访问它。希望你能帮忙!
解决方案
推荐阅读
- mysql - 如何在centos 7中安装mysql shell
- node.js - 是否需要加密node.js中的所有数据
- c# - 如何使用“this.Application.ActiveDocument.Comments.Add”方法为 Word 的 VSTO 外接程序项目生成多个注释?
- typescript - 打字稿中的函数重载和类型推断
- ethereum - 使用反应框“Metamask 不再注入 web3”
- c# - 如何在 2 个用户控件之间切换?
- vue.js - 如何修复 vue.js 中的库添加错误
- ssl - 无法使用零 ssl 验证 github 页面 dns
- c# - C# 中国际象棋的 MiniMax 算法无法正常工作
- python - 如何处理代码以避免被杀?