我正在尝试使用BeautifulSoup在网站上抓取隐藏元素(日期)。但是,我一直得到None类型或以下输出:-。任何帮助将不胜感激!
**This is how the relevant part looks on the website:**
<div class="by C C4">
<span class="hidden-lists">Oct 8, 2018</span>
**This is the relevant portion of my code:**
target_3 = page_soup.find("span", attrs={"class": "hidden-lists"})
print(target_3)
答案 0 :(得分:0)
这里:
target_3.text.strip()
print(target_3)
我不确定这是否可以完全解决您的问题,但请尝试一下。