我正在尝试解析该网站上的HTML 。
我想从所有这些span元素中获取文本class = "post-subject"
例子:
<span class="post-subject">Set of 20 moving boxes (20009 or 20011)</span>
<span class="post-subject">Firestick/Old xbox games</span>
当我在下面运行代码时,soup.find()返回None。我不确定发生了什么事?
import requests
from bs4 import BeautifulSoup
page = requests.get('https://trashnothing.com/washington-dc-freecycle?page=1')
soup = BeautifulSoup(page.text, 'html.parser')
soup.find('span', {'class': 'post-subject'})
繁华开满天机
相关分类