python - 如何使用 Beautiful Soup 从 href 标签下的标签中提取字符串?
问题描述
解决方案
这应该有效。
r = requests.get("https://www.timesjobs.com/candidate/job-search.html?searchType=personalizedSearch&from=submit&txtKeywords=work+from+home&txtLocation=")
b = BeautifulSoup(r.content)
for i in b.select("h2>a"):
print(i.text.strip())
推荐阅读
- javascript - 删除未使用的 JavaScript - babel asyncToGenerator.js - Webpack
- r - 有没有一种简单的方法来减去同一列中的行?
- node.js - 拔出串行设备会导致错误“错误文件描述符”;重新初始化串口最终会收到不一致的数据
- regex - 打印匹配 'pattern' 字符串的行,不包括 'pattern'
- c# - asp net core razor page分配id
- reactjs - 如何在 Windows 应用程序上安装 react-native-video?
- python - 我需要在 django 中为格式化的参考代码创建一个函数
- ruby-on-rails - Rails admin gem 显示 s3 附件,即 IMAGES/PDF/DOCS/XLSX
- python - json数组到熊猫数据框并将其写入csv
- android - 如何在我的 ionic cordova 应用程序中添加 Https?