Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases now! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Getting Started with Beautiful Soup

You're reading from   Getting Started with Beautiful Soup Learn how to extract information from websites using Beautiful Soup and the Python urllib2 module. This practical, hands-on guide covers everything you need to know to get a head start in website scraping.

Arrow left icon
Product type Paperback
Published in Jan 2014
Publisher Packt
ISBN-13 9781783289554
Length 130 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Vineeth G Nair Vineeth G Nair
Author Profile Icon Vineeth G Nair
Vineeth G Nair
Arrow right icon
View More author details
Toc

Quick reference

Here, we will see the following searching methods in Beautiful Soup:

  • find(): This function is used to find the first occurrence
  • find('p'): This function is used to find the first occurrence of a tag
  • find(text="newtext"): This function is used to find the first occurrence of text
  • find(attrs={'id':'value'}): This function is used to find the first occurrence of attributes based on the attribute value
  • find(class_='value'): This function is used to find the first occurrence with the CSS class value
  • find_all(): This function is used to find all occurrences based on filter conditions
  • find_parent(): This function is used to find the first occurrence in parent tags
  • find_parents(): This function is used to find all occurrences in parent tags
  • find_sibling(): This function is used to find the first occurrence in sibling tags
  • find_siblings(): This function is used to find all occurrences in sibling tags
  • find_next(): This function is used to find...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime