This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import struct | |
def get_file_type(file_path): | |
with open(file_path, 'rb') as file: | |
header = file.read(4096) # Citim primii 4096 bytes pentru o analiză mai detaliată | |
# Verificăm semnături comune de fișiere | |
if header.startswith(b'\x89PNG\r\n\x1a\n'): | |
return 'image/png', '.png' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import json | |
import requests | |
from bs4 import BeautifulSoup | |
import os | |
import pickle | |
from storeImages import StoreImages | |
from makePDF import createBook | |
import argparse |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
C:\Users\necul>"c:\Users\necul\AppData\Local\Programs\Python\Python312\python.exe" "e:\Carte\BB\17 - Site Leadership\alte\Ionel Balauta\Aryeht\Task 1 - Traduce tot site-ul\Doar Google Web\Andreea\Meditatii\2023\Chome\GoBooDo-master\GoBooDo.py" --id 1wsYAAAAMAAJ | |
c:\Users\necul\AppData\Local\Programs\Python\Python312\Lib\site-packages\fpdf\__init__.py:39: UserWarning: You have both PyFPDF & fpdf2 installed. Both packages cannot be installed at the same time as they share the same module namespace. To only keep fpdf2, run: pip uninstall --yes pypdf && pip install --upgrade fpdf2 | |
warnings.warn( | |
.88888. 888888ba 888888ba | |
d8' `88 88 `8b 88 `8b | |
88 .d8888b. a88aaaa8P' .d8888b. .d8888b. 88 88 .d8888b. | |
88 YP88 88' `88 88 `8b. 88' `88 88' `88 88 88 88' `88 | |
Y8. .88 88. .88 88 .88 88. .88 88. .88 88 .8P 88. .88 | |
`88888' `88888P' 88888888P `88888P' `88888P' 8888888P `88888P' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import urllib | |
import traceback | |
import regex as re | |
from time import sleep | |
from seleniumwire import webdriver # pip install selenium-wire | |
from progressbar import progressbar as bar | |
from selenium.webdriver.common.keys import Keys | |
from selenium.webdriver.chrome.options import Options | |
from selenium.webdriver.chrome.service import Service # <-- Import Service |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
from selenium import webdriver | |
from selenium.webdriver.chrome.options import Options | |
# Opțiuni pentru Chrome | |
chrome_options = Options() | |
chrome_options.add_argument('--start-maximized') | |
# Inițializează driver-ul Chrome folosind Selenium Manager |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
import requests | |
from bs4 import BeautifulSoup | |
from selenium import webdriver | |
from selenium.webdriver.chrome.service import Service | |
from selenium.webdriver.chrome.options import Options | |
# Utilizarea Selenium Manager pentru a gestiona driverul corect | |
service = Service() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time | |
import requests | |
from bs4 import BeautifulSoup | |
from selenium import webdriver | |
from selenium.webdriver.chrome.service import Service | |
from selenium.webdriver.chrome.options import Options | |
from selenium.common.exceptions import NoSuchElementException | |
# Utilizarea Selenium Manager pentru a gestiona driverul corect |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!doctype html><html lang="ro"><head><meta charset="UTF-8"><meta content="origin" name="referrer"><meta content="/images/branding/googleg/1x/googleg_standard_color_128dp.png" itemprop="image"><title>Google Books</title><script nonce="_zMB-iGD9mW8xIGglGVBRg">window._hst=Date.now();performance&&performance.mark&&performance.mark("SearchHeadStart");</script><script nonce="_zMB-iGD9mW8xIGglGVBRg">(function(){var b=window.addEventListener;window.addEventListener=function(a,c,d){a!=="unload"&&b(a,c,d)};}).call(this);(function(){var _g={kEI:'ITblZs64CdX-7_UPi9ftoA4',kEXPI:'31',kBL:'dzg3',kOPI:89978449};(function(){var a;((a=window.google)==null?0:a.stvsc)?google.kEI=_g.kEI:window.google=_g;}).call(this);})();(function(){google.sn='web';google.kHL='ro';})();(function(){ | |
var h=this||self;function l(){return window.google!==void 0&&window.google.kOPI!==void 0&&window.google.kOPI!==0?window.google.kOPI:null};var m,n=[];function p(a){for(var b;a&&(!a.getAttribute||!(b=a.getAttribute("eid")));)a=a.parentNode;return b||m} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import requests | |
from bs4 import BeautifulSoup | |
# URL-ul cărții de pe Google Books | |
url = 'https://www.google.ro/books/edition/Valori_clasice/1wsYAAAAMAAJ?hl=ro&gbpv=1' | |
# Trimite o cerere la URL | |
response = requests.get(url) | |
# Verifică dacă cererea a avut succes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import os | |
import time # Adăugăm importul pentru modulul time | |
import requests | |
from bs4 import BeautifulSoup | |
from selenium import webdriver | |
from selenium.webdriver.chrome.service import Service | |
from selenium.webdriver.chrome.options import Options | |
# Utilizarea Selenium Manager pentru a gestiona driverul corect | |
service = Service() |
NewerOlder