- Python 3.8+
- DBFlux>= 1.0.2
git clone https://github.com/abbas-bachari/fonedb.git
cd fonedb
pip install .from fonedb import FoneDB,Storage,Device
DB= Storage(base_db=Sqlite(db_name="phones.db"))
async def scrape():
fone_db = FoneDB(r'Certificates/RapidSSL_TLS_RSA_CA_G1.crt',database=DB)
brands=["Samsung","Xiaomi"]
try:
for brand in brands:
await fone_db.scrape_devices(brand,from_date="2015-01-01",sleep_time=3,start_index=0)
finally:
await fone_db.close()
print(f"✅ Total stored models: {DB.get_record_count()}")
def loade_devices():
total=DB.get_record_count()
total_samsung=DB.get_record_count(conditions=[Device.brand=="Samsung"])
total_xiaomi=DB.get_record_count(conditions=[Device.brand=="Xiaomi"])
print(f"✅ Total stored models: {total}")
print(f"✅ Total stored Samsung models: {total_samsung}")
print(f"✅ Total stored Xiaomi models: {total_xiaomi}")
devices:list[Device]= DB.get()
print("✅ First device:\n", devices[0])
if __name__ == "__main__":
asyncio.run(scrape())
loade_devices()...
...
Load Xiaomi page 35 of 39
Saved 15 devices ...
Load Xiaomi page 36 of 39
Saved 10 devices ...
Load Xiaomi page 37 of 39
Saved 10 devices ...
Load Xiaomi page 38 of 39
Saved 9 devices ...
Load Xiaomi page 39 of 39
Saved 2 devices ...
✅ Total stored models: 1383
✅ Total stored models: 1383
✅ Total stored Samsung models: 976
✅ Total stored Xiaomi models: 407
✅ First device:
{
"model": "SM-E066B/DS",
"brand": "Samsung",
"name": "Samsung SM-E066B/DS Galaxy F06 5G 2025 Standard Edition Global Dual Sim TD-LTE 128GB",
"os_system": "Android",
"os_version": "14",
"sdk_version": 34,
"memory": "128GB",
"regions": "GLOBAL",
"edition": "Standard Edition",
"is_global": true,
"dual_sim": true,
"url": "https://phonedb.net/index.php?m=device&id=24739&c=samsung_sm-e066bds_galaxy_f06_5g_2025_standard_edition_global_dual_sim_td-lte_128gb__samsung_a066"
}}
This project is licensed under the MIT License.
Support development by sponsoring on Github Sponsors.