I'm trying to find all hrefs that are apart of an 'a' element that start with 'start/of/link'. This is what I tried after seeing this as an answer to someone else's similar question, but it did not work.
hrefs = soup.find_all('a', href=re.compile('^/start/of/link'))
I don't get an error or anything but when printing the hrefs variable It is empty
CodePudding user response:
I think it should work like this
soup.find_all('a', {"href" : re.compile('^/start/of/link')})