O'zbek tilida mukammal web parsing va avtomatizatsiya kutubxonasi
Project description
🚀 aiowebuz
O'zbek tilida mukammal web parsing va avtomatizatsiya kutubxonasi!
Bu kutubxona HTTP so'rovlar, HTML parsing, brauzer avtomatizatsiyasi, fayllarni yuklab olish va GUI avtomatizatsiyasini o'z ichiga oladi.
📦 O'rnatish
pip install aiowebuz
🎯 Xususiyatlar
- ✅ Sinxron va asinxron HTTP so'rovlar (requests va httpx)
- ✅ Kuchli HTML parsing (BeautifulSoup va lxml)
- ✅ Brauzer avtomatizatsiyasi (SeleniumBase)
- ✅ Fayllarni yuklab olish (wget)
- ✅ GUI avtomatizatsiya (PyAutoGUI)
- ✅ To'liq o'zbekcha dokumentatsiya
- ✅ Oson va tushunarli interfeys
📚 Foydalanish
1. Oddiy HTTP So'rov
from aiowebuz import WebClient
# Klient yaratish
client = WebClient()
# GET so'rov
response = client.get('https://example.com')
print(response.text)
print(response.status_code)
# POST so'rov
response = client.post('https://api.example.com/data',
json={'ism': 'Ali', 'yosh': 25})
2. Asinxron So'rovlar
import asyncio
from aiowebuz import AsyncWebClient
async def main():
async with AsyncWebClient() as client:
response = await client.get('https://example.com')
print(response.text)
asyncio.run(main())
3. HTML Parsing
from aiowebuz import WebClient
client = WebClient()
response = client.get('https://example.com')
# HTML ni parsing qilish
parser = response.parse()
# Element topish
title = parser.find('h1')
print(title.text())
# Class bo'yicha topish
content = parser.find('.content')
print(content.text())
# Barcha havolalarni topish
links = parser.find_all('a')
for link in links:
print(link.attr('href'))
# CSS selector
element = parser.css('div.main > p')
print(element.text())
# XPath
elements = parser.xpath('//div[@class="content"]//p')
for elem in elements:
print(elem)
4. Brauzer Avtomatizatsiyasi
from aiowebuz import Browser
# Brauzer ochish
with Browser(headless=False) as browser:
# Sahifani ochish
browser.open('https://google.com')
# Qidiruv maydoniga yozish
browser.type('textarea[name="q"]', 'AioWebUz')
# Enter bosish
browser.click('input[name="btnK"]')
# Kutish
browser.wait(2)
# Skrinshot olish
browser.screenshot('natija.png')
5. Fayllarni Yuklab Olish
from aiowebuz import Downloader
# Downloader yaratish
dl = Downloader(output_dir='yuklamalar')
# Bitta faylni yuklash
dl.download('https://example.com/file.pdf')
# Nomi bilan yuklash
dl.download('https://example.com/image.jpg', filename='rasm.jpg')
# Bir nechta fayllarni yuklash
urls = [
'https://example.com/file1.pdf',
'https://example.com/file2.pdf',
]
dl.download_multiple(urls)
6. GUI Avtomatizatsiya
from aiowebuz import Automation
auto = Automation()
# Sichqoncha bilan bosish
auto.click(100, 200)
# Matn yozish
auto.type_text('Salom dunyo!')
# Klaviatura tugmalarini bosish
auto.press('enter')
auto.hotkey('ctrl', 'c')
# Ekran rasmini olish
auto.screenshot('ekran.png')
# Rasm bo'yicha topish va bosish
auto.click_image('tugma.png')
# Scroll qilish
auto.scroll(5) # Yuqoriga
auto.scroll(-5) # Pastga
7. Kompleks Misol
from aiowebuz import WebClient, Browser, Downloader
# 1. Sahifadan ma'lumot olish
client = WebClient()
response = client.get('https://example.com/products')
parser = response.parse()
# 2. Mahsulotlarni parsing qilish
products = parser.find_all('.product')
for product in products:
name = product.find('h2').text()
price = product.find('.price').text()
image_url = product.find('img').attr('src')
print(f'{name}: {price}')
# Rasmni yuklash
dl = Downloader()
dl.download(image_url, filename=f'{name}.jpg')
# 3. Brauzer bilan login qilish
with Browser() as browser:
browser.open('https://example.com/login')
browser.type('#username', 'mening_login')
browser.type('#password', 'mening_parol')
browser.click('#login-button')
browser.wait(2)
# Login qilgandan keyin sahifani olish
html = browser.get_page_source()
parser = Parser(html)
# ... davom etish
📖 To'liq Dokumentatsiya
Har bir modul uchun batafsil dokumentatsiya:
WebClient- Sinxron HTTP so'rovlarAsyncWebClient- Asinxron HTTP so'rovlarParser- HTML parsingBrowser- Brauzer avtomatizatsiyasiDownloader- Fayllarni yuklab olishAutomation- GUI avtomatizatsiya
🤝 Hissa Qo'shish
Loyihaga hissa qo'shishni xohlasangiz, Pull Request yuboring!
📄 Litsenziya
MIT License
👨💻 Muallif
Ozodbek Sobirjonovich - oscoder@gmail.com
🌟 Qo'llab-quvvatlash
Agar loyiha foydali bo'lsa, GitHub'da ⭐ qo'ying!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file aiowebuz-1.0.0.tar.gz.
File metadata
- Download URL: aiowebuz-1.0.0.tar.gz
- Upload date:
- Size: 12.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c13154af4ae06b9dade911aedd140bdcdc7b0c3df0fbf068648e0d841c1ce9b4
|
|
| MD5 |
8c1612f006a460a264ff3931ea054fb0
|
|
| BLAKE2b-256 |
28781bfefb7f5683a3c662d196ee73358684384e2dbca6296d4dc1856984afa4
|
File details
Details for the file aiowebuz-1.0.0-py2.py3-none-any.whl.
File metadata
- Download URL: aiowebuz-1.0.0-py2.py3-none-any.whl
- Upload date:
- Size: 12.7 kB
- Tags: Python 2, Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
874ca8f5485f6519bf3b2cdaa449fd1623e71b3e04c1af42596967e0410c1c16
|
|
| MD5 |
585e9d7db8b5980d279f151085d89c5d
|
|
| BLAKE2b-256 |
78d2f80938ce5ebc60dd913385defcd8efde103cc3715ce24d35b518e4867603
|