【发布时间】:2019-08-29 16:11:06
【问题描述】:
我正在尝试使用漂亮的汤在此网站http://www.singaporepools.com.sg/en/product/Pages/toto_results.aspx 上为“下一个大奖”刮取金额,但我很难获得 1,000,000(目前)
我目前正在阅读这本书:用 python 自动化无聊的东西。我在这里花了将近 2 个小时阅读在线教程和过去的问题,但我仍然无法弄清楚如何为大多数教程显示的没有 class 或 id 的元素执行此操作
import requests, bs4
res=requests.get('http://www.singaporepools.com.sg/en/product/Pages/toto_results.aspx')
res.raise_for_status()
noStarchSoup = bs4.BeautifulSoup(res.text, "html.parser")
elems = noStarchSoup.find('span', {'style':'color'}, {'style':'font-weight'})
【问题讨论】:
标签: python web-scraping beautifulsoup