build0015

This commit is contained in:
Hell13Cat
2021-12-29 01:40:59 +03:00
parent fb012b7686
commit 6d347cb1cd
3 changed files with 35 additions and 2 deletions
+13
View File
@@ -15,6 +15,19 @@ def get_data(url):
datas["text"] = (soup.find("body").text).replace("\\n", " ")
return datas
def get_links(url):
links = []
scraper = cfscrape.CloudflareScraper()
req = scraper.get(url)
soup = BeautifulSoup(req.text, 'lxml')
datas = soup.find_all("a")
for one_data in datas:
try:
links.append(one_data.get("href"))
except:
pass
return links
def save_data(datas):
try:
data = db.load("pages")