From c7b7a22a46064c6362eebb5670022b06bf601daf Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Thu, 25 Jun 2015 21:41:23 -0400 Subject: Introduced the select_one() method, which uses a CSS selector but only returns the first match, instead of a list of matches. [bug=1349367] --- doc/source/index.rst | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'doc/source/index.rst') diff --git a/doc/source/index.rst b/doc/source/index.rst index d35481e..1b7b1e6 100644 --- a/doc/source/index.rst +++ b/doc/source/index.rst @@ -1735,6 +1735,10 @@ Match language codes:: #

Howdy, y'all

, #

Pip-pip, old fruit

] +Find only the first tag that matches a selector:: + + soup.select_one(".sister") + # Elsie This is all a convenience for users who know the CSS selector syntax. You can do all this stuff with the Beautiful Soup API. And if CSS -- cgit v1.2.3