lines = []
total_check = 0
with pdfplumber.open(file) as pdf:
pages = pdf.pages
for page in pdf.pages:
text = page.extract_text()
for line in text.split('\n'):
print(line)
output data:
Totaalbedrag excl. btw € 25,00
When I try to retrieve VAT from data:
KVK_re = re.compile(r'(excl. btw .+)')
KVK_re.search(data).group(0)
output: AttributeError: 'NoneType' object has no attribute 'group'
KVK_re = re.compile(r'(excl. btw .+)')
KVK_re.search(r'excl. btw € 25,00').group(0)
output: 'excl. btw € 25,00'
How is it possible that when I paste the literal output in a search it does find the number € 25,00 and when I enter the data variable it does not?
Please help me!