I am trying to find a string "USB 2 ports" in a number of HTML pages. The problem is that the strings have a large amount of white space before them - sometimes 4, 20 or even 50 white space characters.
The following works with a single white space character preceding my string:
soup.find(text=' USB 2 ports')
Note the single space before the USB.
How can I tell Beautiful Soup's find()
to find my string while ignoring all preceding white space?