Sep-24-2020, 08:52 AM
Thanks for your contibution but unfortunately it did not work when I implemented to your code into mine.
I'll send the part of my code.
this will get the keyword that you want to enter
After it compares the "lists" list you can see if you click on valilik web scratching then adana.
but somehow it did not compare them all it always returns the same variables in "lists" Could you please check that out.
Thanks for your help.
I'll send the part of my code.
import tkinter as tk from googlesearch import search from tkinter import messagebox import webbrowser from bs4 import BeautifulSoup import requests from PIL import Image, ImageTk import time import pandas as pd keywords = [] def get(): guess = Entry.get() keywords.append(guess) # print(keywords) global label3 label3=tk.Label(lower_frame,text="İstediğiniz iletilmiştir",bg="#ECECF2") root.after(4000,label3.destroy) label3.pack() Entry.delete(0,tk.END) return keywords def adana_web_scraping(): source = requests.get("http://adana.gov.tr/duyurular").text soup = BeautifulSoup(source,'lxml') mydivs = soup.find('a',class_='announce-text') title = mydivs.text x=title.split(' ') lists=x[32:] word=get() print(word) print(lists) word=[x.lower() for x in word] flag=0 a=[] lists=[x.lower() for x in lists] str1=" " # str1.join(word) for bitem in word: for aitem in lists: if bitem in aitem: print(aitem) root = tk.Tk() root.wm_iconbitmap('eshid.ico') root.wm_title('Title') root.geometry("700x500") root.title("EŞHİD GOOGLE TARAMA") root.configure(bg="#E5E6E2") img = Image.open("D:\\Profile\\Desktop\\eshidd.png") photo=ImageTk.PhotoImage(img) lab=tk.Label(image=photo).place(x=0,y=0) label = tk.Label(root,text="Eşhid Google Tarama",bg="#E5E6E2",font=40) label.pack() Frame=tk.Frame(root,bg="#4784BC",bd=5) Frame.place(relx=0.5,rely=0.1,relwidth=0.75,relheight=0.132,anchor="n") Entry=tk.Entry(Frame,font=40,bd=4) Entry.place(relwidth=0.5,relheight=0.5,relx=0.01) Keyentry=tk.Entry(Frame,font=40,bd=4) Keyentry.place(relx=0.01,rely=0.82,anchor="w",relwidth=0.50,relheight=0.50) buttonstart = tk.Button(Frame,text="Kelimeleri Google'da Ara",font=40,command =lambda:searching_displaying_websites()) buttonstart.place(relx = 0.60,rely=0.27,anchor='w',relwidth=0.38,relheight=0.50) Buttonstop=tk.Button(Frame,text="Yazdıklarını İlet",font=40,command=lambda:get()) Buttonstop.place(relx=0.60,rely=0.85,anchor="w",relwidth=0.38,relheight=0.50) lower_frame=tk.Entry(root,bg="#ECECF2",bd=5) lower_frame.place(relx=0.5,rely=0.4,relwidth=0.8,relheight=0.5,anchor="n") my_menu=tk.Menu(root) root.config(menu=my_menu) website_menu=tk.Menu(my_menu) my_menu.add_cascade(label="Valilik Web Scratching",menu=website_menu) website_menu.add_command(label="Adana",command=lambda:adana_web_scraping()) root.mainloop()To use the code use the first entry box the write your words and than click the "yazdıklarımı ilet" button.
this will get the keyword that you want to enter
After it compares the "lists" list you can see if you click on valilik web scratching then adana.
but somehow it did not compare them all it always returns the same variables in "lists" Could you please check that out.
Thanks for your help.