python - How to limit the result of select tag in beautifulsoup? -
for example, have this:
result = soup.select('div#test > div.filters > span.text')
i want limit result of above list 10 items.
in case of find_all()
1 can use limit
argument select()
?
there no limit
argument select()
, can slice resultset:
soup.select('div#test > div.filters > span.text')[:10]
Comments
Post a Comment