如何在bs4.element.ResultSet类型对象中查找标签

问题描述 投票:0回答:2

我正在学习/进行网络抓取并陷入一个问题,我有一个

bs4.element.ResultSet
类型的对象 其中包含一些 div 标签,我想像在
bs4.BeautifulSoup
类型对象

中那样提取它

这是我要提取的 HTML 代码片段

我想要突出显示的代码

所以我就这么做了

from bs4 import BeautifulSoup
import requests
url = 'https://www.simplilearn.com/resources'
result = requests.get(url)
web_page = result.content
soup = BeautifulSoup(web_page, 'html.parser')
article = soup.findAll(class_='contentBySegment') #that gives me bs4.element.ResultSet 

然后,我尝试使用 find 方法,但它不起作用,而是出现错误。 我的目标是获取文章主题名称 可以在该代码的这一部分中看到

那么我该怎么办

python beautifulsoup tags
2个回答
0
投票
from bs4 import BeautifulSoup
import requests

r = requests.get("https://www.simplilearn.com/resources")
soup = BeautifulSoup(r.text, 'html.parser')

for item in soup.findAll("h4", {'class': 'content-title'}):
    print(item.text)

输出:

How to Become a Certified ScrumMaster
Top 20 Agile Scrum Master Interview Questions & Answers
Free eBook: Guide To Scrum Methodology
The Importance of Machine Learning for Data Scientists
Introduction to Data Science: A Tutorial for Beginners
The Roadmap to a Successful Data Science Career With the PG Program From Simplilearn    
Google Discontinued RHS Ads: How Does This Affects Online Marketers?
Penguin 4.0 Update: The Best Advice From Experts You're Not Taking
Digital Marketing Career Guide: A Playbook to Becoming a Digital Marketing Specialist   
Cyber Security Tutorial: The A to Z to get started
What is Computer Security?
Cybersecurity Career Guide: A Comprehensive Playbook to Becoming A Cybersecurity Expert 
12 Reasons to Get a TOGAF Certification
ITIL: Key Concepts and Summary
Free eBook: Enterprise Architecture Salary Report
Project Management Learning Series: Fast Tracking Versus Crashing
Top 10 Reasons to Get a PRINCE2 Certification
Free Mind-map: PMP Certification
Prepare for Important Salesforce Interview Questions and Answers
Salesforce Developer Certification: an overview
Free eBook: Salesforce Developer Salary Report
Top IT Certification Courses For a Rewarding Career
AWS Careers: A Good Move for Cloud Computing Enthusiasts
AWS Career Guide: A Comprehensive Playbook To Becoming an AWS Solution Architect        
Reskilling the Government Workforce for the Digital Age
How important is the Abraham Maslow’s motivation theory in developing the project team  
Report: The Future of IT Jobs in India
Upskilling for the Fourth Industrial Revolution
Selling Your Idea to Leadership
IDC Study: How Blended Learning Impacts Training Success
The Top 5 Myths of Digital Transformation
Course Announcement: Simplilearn’s Introduction to Digital Transformation
Skilling 4.0: A Study on Digital Readiness
4 Great Ways to Usher in National Technology Day
Go Programming Language: An Introduction
40+ Resources to Help You Learn Java Online

0
投票

数字营销最佳课程:您的成功之路 在当今的数字时代,数字营销已成为商业运营的关键要素。就读数字营销学校可能是推进您的职业生涯或在这个令人兴奋的行业开展新职业的明智选择,因为对合格的数字营销人员的需求不断增长。无论您是试图提升职业生涯的经验丰富的营销专家,还是正在考虑其他选择的应届毕业生,选择理想的数字营销课程对于您的成功至关重要。

为什么要学习数字营销的课程? 在讨论选择正确课程的具体细节之前,让我们先了解一下将时间和资源投入到数字营销活动中的好处。数字营销课程提供许多好处,例如:

紧跟行业趋势:新技术和趋势不断出现,数字格局始终在变化。参加数字营销课程可以保证您及时了解行业发展和最佳实践。 提高您的技能范围:数字营销是一个多学科领域,包括电子邮件营销、社交媒体营销、内容营销、搜索引擎优化等。对数字营销的深入研究可以为您提供对当今劳动力有用的各种技能。 职业发展机会:拥有数字营销方面的专业知识使您成为多个行业公司的宝贵资源。无论您的目标是在当前公司内晋升还是寻求新的前景,数字营销培训都可以帮助您取得职业发展。 选择数字营销课程时要考虑的重要事项 选择最好的数字营销课程可能很困难,因为有太多可供选择的课程。考虑这些关键因素以便做出明智的选择:

认证认可 确保您选择的课程已获得受人尊敬的机构或行业协会的批准。经认可的组织的认证可以验证您的资历并增强您的招聘前景。

检查课程大纲,确保其涵盖品牌、SEO、PPC 广告、社交媒体策略和分析等基本主题。寻找具有全面且最新课程的项目。

教学方法 检查课程中使用的教学方法,包括案例研究、互动讨论、实践项目和讲师的讲座。根据您的喜好和学习风格选择课程形式。

讲师的知识和经验 检查教师的背景和资格。理想情况下,讲师应该拥有提供有趣和教育性指导的历史,以及在数字营销领域工作的实际经验。

评价和排名 检查以前参与者的评论和证词,以确定课程的地位和有效性。考虑那些受到前学生好评和反馈的课程,他们在实际环境中有效地运用了所学知识。

世界上最好的数字营销学校 在讨论了关键的考虑因素之后,让我们来看看全球范围内提供的一些顶级数字营销课程。

提供数字营销课程的网站 Coursera、Udemy 和 LinkedIn Learning 等在线学习网站提供许多不同的数字营销课程,适合所有技能水平的学生。借助这些平台提供的自由,您可以按照自己的节奏在全球任何地方学习。

学院和大学课程 许多大学和学院都提供数字营销课程,作为其专业发展或继续教育课程的一部分,从而广泛提供数字营销课程。除了更加严格的课程之外,这些计划还可能提供网络和指导机会。

© www.soinside.com 2019 - 2024. All rights reserved.