Beautifulsoup entry işlemi

Merhaba arkadaşlar entry ile aldığım değeri söylediğim yere yazdırıp işlem yapmak istiyorum

‘usd’: [BeautifulSoup.get_text(parse.find(id=‘tdUSDBuy’))[:7], str(float(BeautifulSoup.get_text(parse.find(id=‘tdUSDSell’)))*2)[:7]],

*2 yazılan kısma entryden aldığım rakamı yazdırıp öyle ekrana yazdırmak istiyorum yardımcı olabilir misiniz?

KOD:

from tkinter import *
import requests
from bs4 import BeautifulSoup
import json
from selenium import webdriver

def OpenNewWindow():
newWindow = Toplevel()
newWindow.title(“Ayarlar”)
Label(newWindow, text=“Değeri giriniz:”).pack()

def kar():

    veri = entry1.get()
    float(veri)

entry1 = Entry(newWindow, width=20)
entry1.pack()

button4 = Button(newWindow, text="Tamam", command= kar)
button4.pack()

button3= Button(newWindow, text="Kapat", command=lambda: newWindow.destroy())
button3.pack(side=BOTTOM)

newWindow.geometry("200x200+480+0")

def calculate():

response = requests.get(
    'https://www.altinkaynak.com/Doviz/Kur/Guncel').content
parse = BeautifulSoup(response, 'html.parser')
return {'usd': [BeautifulSoup.get_text(parse.find(id='tdUSDBuy'))[:7], str(float(BeautifulSoup.get_text(parse.find(id='tdUSDSell'))))[:7]],
        'eur': [BeautifulSoup.get_text(parse.find(id='tdEURBuy'))[:7], BeautifulSoup.get_text(parse.find(id='tdEURSell'))[:7]],
        'gbp': [BeautifulSoup.get_text(parse.find(id='tdGBPBuy'))[:7], BeautifulSoup.get_text(parse.find(id='tdGBPSell'))[:7]],
        'azn': [BeautifulSoup.get_text(parse.find(id='tdAZNBuy'))[:7], BeautifulSoup.get_text(parse.find(id='tdAZNSell'))[:7]],
        'sek': [BeautifulSoup.get_text(parse.find(id='tdSEKBuy'))[:7], BeautifulSoup.get_text(parse.find(id='tdSEKSell'))[:7]],
        'jpy': [BeautifulSoup.get_text(parse.find(id='tdJPYBuy'))[:7], BeautifulSoup.get_text(parse.find(id='tdJPYSell'))[:7]],
        'sar': [BeautifulSoup.get_text(parse.find(id='tdSARBuy'))[:7], BeautifulSoup.get_text(parse.find(id='tdSARSell'))[:7]],
        'aed': [BeautifulSoup.get_text(parse.find(id='tdAEDBuy'))[:7], BeautifulSoup.get_text(parse.find(id='tdAEDSell'))[:7]],
        'rub': [BeautifulSoup.get_text(parse.find(id='tdRUBBuy'))[:7], BeautifulSoup.get_text(parse.find(id='tdRUBSell'))[:7]],
        'cny': [BeautifulSoup.get_text(parse.find(id='tdCNYBuy'))[:7], BeautifulSoup.get_text(parse.find(id='tdCNYSell'))[:7]],
        'dkk': [BeautifulSoup.get_text(parse.find(id='tdDKKBuy'))[:7], BeautifulSoup.get_text(parse.find(id='tdDKKSell'))[:7]]}

def calculate_coin():
with open(‘coin.json’, encoding=‘utf-8’) as f:
coin_list = json.load(f)

coin_price_list = {}
driver_list = []

for enumer, coin in enumerate(coin_list):
    driver_list.append(webdriver.Chrome())
    option = webdriver.ChromeOptions()
    option.add_argument('headless')
    driver_list[enumer] = webdriver.Chrome(chrome_options=option)
    driver_list[enumer].get('https://www.coindesk.com/price/'+coin)
    coin_price_list[coin] = BeautifulSoup.get_text(BeautifulSoup(driver_list[enumer].page_source, 'html.parser').find('div', {'class': 'price-large'}))[1:]

return driver_list, coin_price_list

“”“for i in range(10):
a,b = calculate_coin()
print(a,b)
“””

Merhaba.
Kodunuzu buraya göre düzenleyip atarsanız kodunuzu deneyip size daha kolay yardımcı olabiliriz :slight_smile: