你的beautifulsoup pull太具体了。您正在捕获所有“span”标签,其中 class = value。
当您查看 HTML 时,您可以通过搜索某些字段的文本快速找到该部分。您应该做的是在 class = 'infoEntity' 的任何 div 标签中获取所有内容,其中包含您有兴趣从“概述”部分获取的所有 7 个字段。
其中,每个字段都有一个标签标签,其具有与上面所需的标签相关的属性,这些属性位于“概述”部分。
所以,开始:
from bs4 import BeautifulSoup
data = """
Enhanced Profile
Try Enhanced Profile Free for a Month
Explore the many benefits of having a premium branded profile on Glassdoor, like increased influence and advanced analytics.
Get StartedChanges wont be saved until you sign up for an Enhanced Profile subscription.