Update 3.5
This commit is contained in:
11
avsox.py
11
avsox.py
@@ -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'))
|
||||
Reference in New Issue
Block a user