Update 3.5

This commit is contained in:
Yoshiko2
2020-06-21 23:53:08 +08:00
committed by GitHub
parent b016113fc1
commit 2c6169b340
10 changed files with 117 additions and 42 deletions

View File

@@ -72,6 +72,13 @@ def getTag(a): # 获取演员
for i in a:
d.append(i.get_text())
return d
def getSeries(htmlcode):
try:
html = etree.fromstring(htmlcode, etree.HTMLParser()) # //table/tr[1]/td[1]/text()
result1 = str(html.xpath('//span[contains(text(),"系列:")]/../span[2]/text()')).strip(" ['']")
return result1
except:
return ''
def main(number):
a = get_html('https://avsox.host/cn/search/' + number)
@@ -108,8 +115,10 @@ def main(number):
'actor_photo': getActorPhoto(web),
'website': result1,
'source': 'avsox.py',
'series': getSeries(info),
}
js = json.dumps(dic, ensure_ascii=False, sort_keys=True, indent=4, separators=(',', ':'), ) # .encode('UTF-8')
return js
#print(main('012717_472'))
if __name__ == "__main__":
print(main('012717_472'))