Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: utf-8 -*-
- from bs4 import BeautifulSoup as bs
- content = []
- with open("test.xml") as testFile:
- # można to zrobić prościej
- bs_content = bs(testFile, "xml")
- print(bs_content)
- # jeśli nie wierz co to lambda, polecam poczytać
- test1 = bs_content.find_all(lambda tag: tag.name == "Content" and "Wartość" in tag.get_text())
- print (test1)
- # teraz wystarczy wyciągnąć liczbę z tagów Content
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement