human
Python BeautifulSoup Extract specific URLs
assistant
Here is some code to find all anchors with a hyperlink that matches the pattern '^(?!(?:[a-zA-Z][a-zA-Z0-9+.-]*:|//))'

soup.find_all('a', href=re.compile('^(?!(?:[a-zA-Z][a-zA-Z0-9+.-]*:|//))'))

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.