我正在编写一个程序,该程序将我的学校成绩作为我的桌面背景,当该程序从网站解析我的成绩时,它会将它们全部返回
从学校成绩网站检索成绩的代码:
for cell in driver.find_elements_by_css_selector(".grid tr a[href$='fg=S2']"):
print cell.text
cell.text 返回为
--
B
84
--
A-
90
--
C+
79
--
A
95
--
B
82
--
B
81
但是我需要将它输入回我的桌面 BG 的图像中
font = ImageFont.load_default()
img = Image.open('bg.bmp')
draw = ImageDraw.Draw(img)
now = datetime.datetime.now()
draw.text((650, 450),' CURRENT GRADES' )
draw.text((650, 500), 'Period 1: Geography -----------------------------')#First Grade
draw.text((650, 550), 'Period 2: Francais-------------------------------')#Second Grade
draw.text((650, 600), 'Period 3: Science--------------------------------')#Third Grade
draw.text((650, 650), 'Period 4: P.E------------------------------------')#Fourth Grade
draw.text((650, 700), 'Period 5: Algebra 9------------------------------')#Fifth Grade
draw.text((650, 750), 'Period 6: LA-------------------------------------')Sixth grade
draw.text((650, 800), 'Last Updated: {0}'.format(now))
draw = ImageDraw.Draw(img)
draw = ImageDraw.Draw(img)
img.save('mod_bg.bmp')
当成绩返回时,我需要将它们放入每个班级
如果需要任何信息,请询问谢谢