问题描述
我一直在尝试使用Python的漂亮汤从网站上抓取两个值,这给我带来了麻烦。这是我要抓取的页面的URL: https://www.stjosephpartners.com/Home/Index
以下是我要抓取的值: HTML of Website to be Scraped
我尝试过:
from bs4 import BeautifulSoup
import requests
source = requests.get('https://www.stjosephpartners.com/Home/Index').text
soup = BeautifulSoup(source,'lxml')
gold_spot_shell = soup.find('div',class_ = 'col-lg-10').children
print(gold_spot_shell)
我得到的输出是:<list_iterator object at 0x039FD0A0>
当我尝试使用:gold_spot_shell = soup.find('div',class_ = 'col-lg-10').children
输出为:['\n']
当我尝试使用:gold_spot_shell = soup.find('div',class_ = 'col-lg-10').span
输出为:none
HTML肯定至少有一个span子级。我不确定如何抓取我追求的价值。谢谢。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)