Beautifulsoup ile çekilen verinin bir kısmını alma


#1
# -*- coding: utf-8 -*-
from kivy.app import App
from kivy.lang import Builder
import requests
from bs4 import BeautifulSoup

kv="""
BoxLayout:
    orientation:"vertical"
    TextInput:
        text:"veri al"
        id: lbl
        multiline:True
    Button:
        text:"al"
        size_hint_y:.2
        on_press:app.al()
"""
url="https://namazvakitleri.diyanet.gov.tr/tr-TR"
veri=requests.get(url)
soup=BeautifulSoup(veri.content,"html.parser")
#print(soup)
al=soup.find_all("div",attrs={"class":"tpt-time"})
print(al)
class veriApp(App):
	def build(self):
		return Builder.load_string(kv)
	
	def al(self):
		veri=self.root.ids.lbl.text
		self.root.ids.lbl.text="%s"% str((soup.text).encode('utf-8'))
		print(veri)
		
		
veriApp().run()

#böyle yapınca kivy üzerinde sitenin tüm verisini alıyor.sadece vakitleri nasıl alabilirim.


#2

kivy’ den anlamıyorum ama td içeriklerini böyle düzenleyerek alabilirsiniz.


# -*- coding: utf-8 -*-
from kivy.app import App
from kivy.lang import Builder
import requests
from bs4 import BeautifulSoup
import urllib.request

kv="""
BoxLayout:
    orientation:"vertical"
    TextInput:
        text:"veri al"
        id: lbl
        multiline:True
    Button:
        text:"al"
        size_hint_y:.2
        on_press:app.al()
"""
url="https://namazvakitleri.diyanet.gov.tr/tr-TR"
veri=urllib.request.urlopen(url)
soup=BeautifulSoup(veri,"html.parser")

al_=soup.select("table tr td")
for i in al_:
    print(i.text)

class veriApp(App):
	def build(self):
		return Builder.load_string(kv)
	
	def al(self):
		veri=self.root.ids.lbl.text
		deger =self.root.ids.lbl.text="%s"% str((soup.text).encode('utf-8'))
		print(veri)
        
		
		
veriApp().run()