Quick reference
Here, we will see the following searching methods in Beautiful Soup:
find()
: This function is used to find the first occurrencefind('p')
: This function is used to find the first occurrence of a tagfind(text="newtext")
: This function is used to find the first occurrence of textfind(attrs={'id':'value'})
: This function is used to find the first occurrence of attributes based on the attribute valuefind(class_='value')
: This function is used to find the first occurrence with theCSS
class valuefind_all()
: This function is used to find all occurrences based on filter conditionsfind_parent()
: This function is used to find the first occurrence in parent tagsfind_parents()
: This function is used to find all occurrences in parent tagsfind_sibling()
: This function is used to find the first occurrence in sibling tagsfind_siblings()
: This function is used to find all occurrences in sibling tagsfind_next()
: This function is used to find...