I’m trying to get the results from a page using BeautifulSoup:
JavaScript
x
8
1
req_url = 'http://www.xscores.com/soccer/livescores/25-02'
2
request = requests.get(req_url)
3
content = request.content
4
soup = BeautifulSoup(content, "html.parser")
5
scores = soup.find_all('tr', {'style': 'height:18px;'}, limit=None)
6
print(len(scores))
7
>50
8
I read this previous solution: Beautiful Soup findAll doesn’t find them all and I tried html.parser, lxml and html5lib, but none of them return more than 50 results. Any suggestions?
Advertisement
Answer
Try using css-selector
query.
JavaScript
1
5
1
scores = soup.select('#scoretable > tr[style*="height:18px;"]')
2
print(len(scores))
3
4
>>>613
5