first commit

This commit is contained in:
2024-11-23 13:38:17 +01:00
parent 678203b19f
commit fb915042df
99 changed files with 6624 additions and 0 deletions

13
referencement/search.py Normal file
View File

@@ -0,0 +1,13 @@
import requests
from bs4 import BeautifulSoup
def search(url):
r = requests.get(url)
return r.text
def search_urls_in_text(content):
soup = BeautifulSoup(content, 'html5lib')
hrefs = [a['href'] for a in soup.find_all('a', href=True)]
return hrefs
print(search_urls_in_text(search("https://google.com")))