File size: 990 Bytes
aead09a
 
 
 
aa30d73
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
aead09a
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import gradio as gr
import requests 


def find_it(inp):
   try:
        url = f"https://lens.google.com/uploadbyurl?url={inp}"
        response = requests.get(url)
        if response.status_code == 200:
            page_content = response.text
            
            soup = BeautifulSoup(page_content, "html.parser")
            #print(soup.prettify())
            #articles = soup.find_all("div", class_="SoaBEf")
            #articles = soup.find_all("a")
            #articles = soup.find_all("article", class_="MQsxIb xTewfe R7GTQ keNKEd j7vNaf Cc0Z5d VkAdve GU7x0c JMJvke q4atFc")
            articles = soup.find_all("article") 
            print (articles)
    except Exception as e:
        print (e)

#https://lens.google.com/uploadbyurl?url=
#https://tineye.com/search/?url=
#https://yandex.com/images/search?cbir_id=4330355%2FBhPd4CHqib3nxk9xOdS9pQ7899&rpt=imageview&url=


with gr.Blocks() as app:
    inp_url=gr.Textbox(label="Image URL")
    inp_im=gr.Image()
app.launch()