Skip to content

Commit 4008744

Browse files
Commit Explain Code
1 parent c62c1a4 commit 4008744

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+11402
-0
lines changed

.gitignore

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
Adobe_After_Effects/
2+
Adobe_Illustrator/
3+
Adobe_Photoshop/
4+
Adobe_Premiere_Pro/
5+
Automation/
6+
Build/
7+
Data_Json/
8+
Design/
9+
Output/
10+
Script/
11+
Build/
12+
Build/

LICENSE

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
MIT License
2+
Copyright (c) 2025 Hossam Rashad
3+
📍 +0201091642528
4+
📍 +0201101853042

Python/Css/Font/Omnes_Bold.ttf

137 KB
Binary file not shown.

Python/Css/style.css

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
@font-face {
2+
font-family: 'Omnes';
3+
src: url('./Font/Omnes_Bold.ttf') format('truetype');
4+
font-weight: bold;
5+
font-style: normal;
6+
}
7+
8+
body {
9+
font-family: 'Omnes', sans-serif;
10+
padding: 0;
11+
margin: 0;
12+
display: flex;
13+
justify-content: center;
14+
align-items: center;
15+
height: 100vh;
16+
}
17+
18+
.wrapper {
19+
width: 85%;
20+
margin: auto;
21+
padding: 2rem;
22+
text-align: center;
23+
border: 0.3rem solid #8c00ff;
24+
border-radius: 1rem;
25+
-webkit-border-radius: 1rem;
26+
-moz-border-radius: 1rem;
27+
-ms-border-radius: 1rem;
28+
-o-border-radius: 1rem;
29+
}
30+
31+
.title {
32+
display: block;
33+
text-align: center;
34+
font-size: 5vw;
35+
margin-top: 3rem;
36+
margin-bottom: 3rem;
37+
border: 0.3rem solid #ffeaa7;
38+
background-color: #fdcb6e;
39+
color: #222;
40+
border-radius: 0.5rem;
41+
padding: 2rem;
42+
}
43+
.text {
44+
border: 0.3rem solid #7d5afd;
45+
margin-top: 3rem;
46+
background-color: #a29bfe;
47+
color: #fff;
48+
color: #222;
49+
font-size: 2.5vw;
50+
padding: 2rem;
51+
border-radius: 0.5rem;
52+
-webkit-border-radius: 0.5rem;
53+
-moz-border-radius: 0.5rem;
54+
-ms-border-radius: 0.5rem;
55+
-o-border-radius: 0.5rem;
56+
}
57+
.data {
58+
border: 0.3rem solid rgb(255, 0, 191);
59+
margin-top: 3rem;
60+
background-color: #ff7675;
61+
font-size: 1.5vw;
62+
color: #fff;
63+
border-radius: 0.5rem;
64+
-webkit-border-radius: 0.5rem;
65+
-moz-border-radius: 0.5rem;
66+
-ms-border-radius: 0.5rem;
67+
-o-border-radius: 0.5rem;
68+
}

Python/Web_Scraping.py

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
2+
3+
from flask import Flask, jsonify
4+
import requests
5+
from bs4 import BeautifulSoup
6+
7+
app = Flask(__name__)
8+
9+
# URL of the site from which the data will be pulled
10+
url = 'https://web-scraping-project.pages.dev/'
11+
# Local site URL
12+
# url = 'http://127.0.0.1:5500/Python/index.html'
13+
14+
# Data pull function
15+
16+
17+
def scrape_data():
18+
response = requests.get(url)
19+
20+
# Verify the success of the request
21+
if response.status_code == 200:
22+
soup = BeautifulSoup(response.text, 'html.parser')
23+
24+
# Extract address
25+
title = soup.find('h2').text if soup.find('h2') else 'No title found'
26+
27+
# Text extraction
28+
text = soup.find('p').text if soup.find('p') else 'No text found'
29+
30+
# Extract description from meta
31+
description = soup.find('meta', {'name': 'description'})
32+
description = description['content'] if description else 'No description found'
33+
34+
# Extract some data from div
35+
data_paragraphs = soup.find_all('p', class_='info')
36+
data = [p.text for p in data_paragraphs]
37+
38+
return {
39+
'title': title,
40+
'text': text,
41+
'description': description,
42+
'data': data
43+
}
44+
else:
45+
return {'error': 'Failed to retrieve data'}
46+
47+
48+
@app.route('/', methods=['GET'])
49+
def get_scraped_data():
50+
# Call the scrape_data function
51+
data = scrape_data()
52+
return jsonify(data)
53+
54+
55+
if __name__ == '__main__':
56+
# Run the application on localhost
57+
app.run(debug=True)

Python/index.html

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<!DOCTYPE html>
2+
<html lang="ar">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta
6+
name="description"
7+
content="This is a sample description for the webpage"
8+
/>
9+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
10+
<link
11+
rel="stylesheet"
12+
href="https://cdnjs.cloudflare.com/ajax/libs/animate.css/4.1.1/animate.min.css"
13+
/>
14+
<title>Web Scraping Example</title>
15+
<link rel="stylesheet" href="Css/style.css" />
16+
</head>
17+
<body>
18+
<div class="wrapper">
19+
<h2 class="title animate__animated animate__backInUp animate__delay-1s">
20+
Welcome to the data pull example.!
21+
</h2>
22+
<p class="text animate__animated animate__backInUp animate__delay-2s">
23+
This is a page with some data that can be fetched using Python.
24+
</p>
25+
26+
<div class="data animate__animated animate__backInUp animate__delay-3s">
27+
<p class="info">Important data: 12345</p>
28+
<p class="info">the date: 2025-04-12</p>
29+
</div>
30+
</div>
31+
</body>
32+
</html>

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
# Web_Scraping
2+
3+
## web_scraping
4+
25
Web Scraping

requirements.txt

Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
annotated-types==0.7.0
2+
anyio==4.9.0
3+
asgiref==3.8.1
4+
audioop-lts==0.2.1
5+
audioread==3.0.1
6+
beautifulsoup4==4.13.3
7+
blinker==1.9.0
8+
cachetools==5.5.2
9+
certifi==2025.1.31
10+
cffi==1.17.1
11+
charset-normalizer==3.4.1
12+
click==8.1.8
13+
colorama==0.4.6
14+
comtypes==1.4.10
15+
contourpy==1.3.1
16+
cycler==0.12.1
17+
decorator==5.2.1
18+
distro==1.9.0
19+
Django==5.1.7
20+
django-cors-headers==4.7.0
21+
djangorestframework==3.15.2
22+
djangorestframework_simplejwt==5.5.0
23+
ffmpeg-python==0.2.0
24+
filelock==3.18.0
25+
Flask==3.1.0
26+
fonttools==4.56.0
27+
fsspec==2025.3.0
28+
future==1.0.0
29+
google-api-core==2.24.2
30+
google-api-python-client==2.165.0
31+
google-auth==2.38.0
32+
google-auth-httplib2==0.2.0
33+
googleapis-common-protos==1.69.2
34+
h11==0.14.0
35+
httpcore==1.0.7
36+
httplib2==0.22.0
37+
httpx==0.28.1
38+
idna==3.10
39+
imageio==2.37.0
40+
imageio-ffmpeg==0.6.0
41+
itsdangerous==2.2.0
42+
Jinja2==3.1.6
43+
jiter==0.9.0
44+
joblib==1.4.2
45+
kiwisolver==1.4.8
46+
lazy_loader==0.4
47+
librosa==0.11.0
48+
llvmlite==0.44.0
49+
lxml==5.3.1
50+
markdown-it-py==3.0.0
51+
MarkupSafe==3.0.2
52+
matplotlib==3.10.1
53+
mdurl==0.1.2
54+
MouseInfo==0.1.3
55+
moviepy==2.1.2
56+
mpmath==1.3.0
57+
msgpack==1.1.0
58+
networkx==3.4.2
59+
nltk==3.9.1
60+
numba==0.61.0
61+
numpy==2.1.3
62+
openai==1.69.0
63+
opencv-python==4.11.0.86
64+
packaging==24.2
65+
pandas==2.2.3
66+
pillow==10.4.0
67+
platformdirs==4.3.7
68+
pooch==1.8.2
69+
proglog==0.1.10
70+
proto-plus==1.26.1
71+
protobuf==6.30.1
72+
psutil==7.0.0
73+
pyasn1==0.6.1
74+
pyasn1_modules==0.4.1
75+
PyAutoGUI==0.9.54
76+
pycparser==2.22
77+
pydantic==2.11.0
78+
pydantic_core==2.33.0
79+
pydub==0.25.1
80+
PyGetWindow==0.0.9
81+
Pygments==2.19.1
82+
PyJWT==2.9.0
83+
PyMsgBox==1.0.9
84+
pyparsing==3.2.1
85+
pyperclip==1.9.0
86+
pypiwin32==223
87+
PyQt5==5.15.11
88+
PyQt5-Qt5==5.15.2
89+
PyQt5_sip==12.17.0
90+
PyRect==0.2.0
91+
PyScreeze==1.0.1
92+
python-dateutil==2.9.0.post0
93+
python-docx==1.1.2
94+
python-dotenv==1.1.0
95+
pytrends==4.9.2
96+
pyttsx3==2.98
97+
pytweening==1.2.0
98+
pytz==2025.1
99+
pywin32==310
100+
regex==2024.11.6
101+
requests==2.32.3
102+
rich==13.9.4
103+
rsa==4.9
104+
scikit-learn==1.6.1
105+
scipy==1.15.2
106+
setuptools==78.1.0
107+
six==1.17.0
108+
sniffio==1.3.1
109+
soundfile==0.13.1
110+
soupsieve==2.6
111+
soxr==0.5.0.post1
112+
sqlparse==0.5.3
113+
standard-aifc==3.13.0
114+
standard-chunk==3.13.0
115+
standard-sunau==3.13.0
116+
sympy==1.13.1
117+
textblob==0.19.0
118+
threadpoolctl==3.6.0
119+
torch==2.6.0
120+
torchaudio==2.6.0
121+
torchvision==0.21.0
122+
tqdm==4.67.1
123+
typing-inspection==0.4.0
124+
typing_extensions==4.12.2
125+
tzdata==2025.1
126+
uritemplate==4.1.1
127+
urllib3==2.3.0
128+
Werkzeug==3.1.3
129+
wheel==0.45.1
130+
whisper==1.1.10

web_scraping_django/api/__init__.py

Whitespace-only changes.
Binary file not shown.

0 commit comments

Comments
 (0)