You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pxr3c4n65/step1.py

23 lines
388 B

4 years ago
# -*- coding: utf-8 -*-
# author: youxinyu
# githb: yogayu
4 years ago
from pyquery import PyQuery as pq
f = open("step2/index.html", encoding='utf-8')
4 years ago
html = f.read()
f.close()
doc = pq(html)
tag = input()
result = ""
if tag == "meta":
tag = doc('meta:nth-child(4)')
attr = input()
result = tag.attr(attr)
else:
tag = doc(tag)
4 years ago
result = doc(tag).text()
print (result, end='')
4 years ago