Skip to content

Commit 1c1c9c7

Browse files
committed
initial build
1 parent a8ea1bb commit 1c1c9c7

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

Link-Preview/README.md

Whitespace-only changes.

Link-Preview/db.json

Whitespace-only changes.

Link-Preview/linkPreview.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import requests
2+
from bs4 import BeautifulSoup
3+
4+
url = 'https://www.girlscript.tech/'
5+
r = requests.get(url)
6+
soup = BeautifulSoup(r.text,"html.parser")
7+
# print(soup)
8+
9+
title = soup.find("meta", property = "og:title")
10+
description = soup.find("meta", property = "og:description")
11+
url = soup.find("meta", property = "og:url")
12+
img = soup.find("meta", property = "og:image")
13+
14+
15+
print("Title : ", title.get("content", None))
16+
print("Description : ", description.get("content", None))
17+
print("URL : ", url.get("content", None))
18+
print("Image Link : ", img.get("content", None))

Link-Preview/requirements.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
requests==2.25.1
2+
beautifulsoup4==4.9.3

0 commit comments

Comments
 (0)