from bs4 import BeautifulSoup

#uses beautiful soup to parse html file
#finds the correct span tag
#Gets the percentage of ink left in the printer
soup = BeautifulSoup(open("test/test.html"))
res =  soup.find('span',{'class':'hpConsumableBlockHeaderText'}).text
num = res[24] + res[25] 


from bs4 import BeautifulSoup

#uses beautiful soup to parse html file
#finds the correct span tag
#Gets the percentage of ink left in the printer
soup = BeautifulSoup(open("test/test.html"))
res =  soup.find('span',{'class':'hpConsumableBlockHeaderText'}).text
num = res[24] + res[25]

file = open('test/data.csv', 'w+') 
file.write(num + ",")


Write information from test.html to csv file
Write information from test.html to csv file

  from bs4 import BeautifulSoup
  
  #uses beautiful soup to parse html file
  #finds the correct span tag
  #Gets the percentage of ink left in the printer
  soup = BeautifulSoup(open("test/test.html"))
  res =  soup.find('span',{'class':'hpConsumableBlockHeaderText'}).text
- num = res[24] + res[25] 
+ num = res[24] + res[25]
+ 
+ file = open('test/data.csv', 'w+') 
+ file.write(num + ",")
  
  
Write information from test.html to csv file
## Code Before:
from bs4 import BeautifulSoup

#uses beautiful soup to parse html file
#finds the correct span tag
#Gets the percentage of ink left in the printer
soup = BeautifulSoup(open("test/test.html"))
res =  soup.find('span',{'class':'hpConsumableBlockHeaderText'}).text
num = res[24] + res[25] 


## Instruction:
Write information from test.html to csv file
## Code After:
from bs4 import BeautifulSoup

#uses beautiful soup to parse html file
#finds the correct span tag
#Gets the percentage of ink left in the printer
soup = BeautifulSoup(open("test/test.html"))
res =  soup.find('span',{'class':'hpConsumableBlockHeaderText'}).text
num = res[24] + res[25]

file = open('test/data.csv', 'w+') 
file.write(num + ",")

