【发布时间】:2021-03-02 00:00:34
【问题描述】:
我正在从网页上抓取体育赔率,如下所示,我从查找请求中获取结果。 .get_text() 将显示 -110 这很好。
如果我想获取{} 中的任何数字怎么办。我将如何获得这些值?
我故意从下面的第一个 div 语句中删除了开始 以便它出现。
results = soup.find('div', attrs={'class':'op-item spread-price'})
print(results)
div class="op-item spread-price" data-op-info='{"fullgame":"-110","firsthalf":"-121","secondhalf":"-115","firstquarter":"-109","secondquarter":"","thirdquarter":"","fourthquarter":""}' data-op-overprice='{"fullgame":"-110","firsthalf":"-109","secondhalf":"-122","firstquarter":"-103","secondquarter":"","thirdquarter":"","fourthquarter":""}'>-110</div
【问题讨论】:
标签: python web-scraping beautifulsoup jupyter-notebook tags