feat: initial commit

This commit is contained in:
patilk 2024-11-12 05:16:21 +01:00
parent ee6018894e
commit b25f04d218
Signed by: s500042
GPG Key ID: 1921AD722E7392EE
4 changed files with 70 additions and 0 deletions

32
.gitignore vendored Normal file
View File

@ -0,0 +1,32 @@
# Ignore Python bytecode files
*.pyc
*.pyo
__pycache__/
# Ignore virtual environment directories
.venv/
venv/
env/
# Ignore system files
.DS_Store
Thumbs.db
# Ignore log files
*.log
# Ignore temporary files
*.tmp
*.swp
# Ignore output files
dist/
build/
*.egg-info/
# Ignore environment files
.env
# IDE files
.idea/
.vscode/

13
app/main.py Normal file
View File

@ -0,0 +1,13 @@
from scraper import scraper
import time
def main():
print("Starting the application...\n\n")
scraper()
print("\n\nApplication finished!")
time.sleep(8)
if __name__ == "__main__":
main()

8
app/requirements.txt Normal file
View File

@ -0,0 +1,8 @@
beautifulsoup4==4.12.3
bs4==0.0.2
certifi==2024.8.30
charset-normalizer==3.4.0
idna==3.10
requests==2.32.3
soupsieve==2.6
urllib3==2.2.3

17
app/scraper.py Normal file
View File

@ -0,0 +1,17 @@
import os
import json
def scraper():
directory = "dist"
file_path = os.path.join(directory, "data.json")
data = []
try:
os.mkdir("dist")
except FileExistsError:
pass
with open(file_path, "w", encoding="utf-8") as file:
json.dump(data, file)
print("Data has been scraped!")