BeautifulSoup find_all限制为50个结果?

Ste*_*enH 5 python lxml beautifulsoup html5lib

我正在尝试使用BeautifulSoup从页面获取结果:

req_url = 'http://www.xscores.com/soccer/livescores/25-02'
request = requests.get(req_url)
content = request.content
soup = BeautifulSoup(content, "html.parser")
scores = soup.find_all('tr', {'style': 'height:18px;'}, limit=None)
print(len(scores))
>50
Run Code Online (Sandbox Code Playgroud)

我读了之前的解决方案:美丽的汤findAll找不到所有 ,我尝试了html.parser,lxml和html5lib,但没有一个返回超过50个结果.有什么建议?

谢谢

Zro*_*roq 2

尝试使用css-selector查询。

scores = soup.select('#scoretable > tr[style*="height:18px;"]')
print(len(scores))

>>>613
Run Code Online (Sandbox Code Playgroud)