修改step1启动脚本

dev_coder
planet 4 years ago
parent b8d53d910d
commit a0e8c910eb

@ -1,28 +1,22 @@
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
# author: youxinyu
# githb: yogayu
from pyquery import PyQuery as pq from pyquery import PyQuery as pq
f = open("step1/index.html", encoding='utf-8') f = open("step2/index.html", encoding='utf-8')
# f = open("../step1/result.html", encoding='utf-8')
html = f.read() html = f.read()
f.close() f.close()
doc = pq(html) doc = pq(html)
tag = input() tag = input()
result = ""
result = '' if tag == "meta":
if tag == 'h1' or 'p': tag = doc('meta:nth-child(4)')
attr = input()
result = tag.attr(attr)
else:
tag = doc(tag)
result = doc(tag).text() result = doc(tag).text()
if tag == 'align':
h1Align= doc('h1').attr('align')
pAlign= doc('p').attr('align')
result = (h1Align and pAlign)
if tag == 'bgcolor':
result = doc('body').attr('bgcolor')
# print(result),
print (result, end='') print (result, end='')

Loading…
Cancel
Save