Fetching metadata from the HF Docker repository...
-
Create install.sh
-
Update app.py
-
Update app.py
import asyncio
from playwright.async_api import async_playwright
from bs4 import BeautifulSoup
import gradio as gr
async def buscar_google_shopping(produto):
async with async_playwright() as p:
browser = await p.chromium.launch(headless=True)
page = await browser.new_page()
await page.goto("https://www.google.com/shopping")
await page.fill("input[name='q']", produto)
await page.keyboard.press("Enter")
await page.wait_for_load_state("networkidle")
try:
await page.click("text=Ordenar por")
await page.click("text=Preço mais baixo")
await page.wait_for_load_state("networkidle")
except:
pass
html = await page.content()
await browser.close()
soup = BeautifulSoup(html, "html.parser")
produtos = []
for item in soup.select("div.sh-dgr__content")[:30]:
nome_tag = item.select_one("h3")
preco_tag = item.select_one(".a8P… -
Create requirements.txt
-
Create app.py
-
initial commit