fix #251
This commit is contained in:
13
fanza.py
13
fanza.py
@@ -15,7 +15,7 @@ from ADC_function import *
|
|||||||
|
|
||||||
def getTitle(text):
|
def getTitle(text):
|
||||||
html = etree.fromstring(text, etree.HTMLParser())
|
html = etree.fromstring(text, etree.HTMLParser())
|
||||||
result = html.xpath('//*[@id="title"]/text()')[0]
|
result = html.xpath('//*[starts-with(@id, "title")]/text()')[0]
|
||||||
return result
|
return result
|
||||||
|
|
||||||
|
|
||||||
@@ -94,9 +94,12 @@ def getRelease(text):
|
|||||||
"//td[contains(text(),'発売日:')]/following-sibling::td/a/text()"
|
"//td[contains(text(),'発売日:')]/following-sibling::td/a/text()"
|
||||||
)[0].lstrip("\n")
|
)[0].lstrip("\n")
|
||||||
except:
|
except:
|
||||||
result = html.xpath(
|
try:
|
||||||
"//td[contains(text(),'発売日:')]/following-sibling::td/text()"
|
result = html.xpath(
|
||||||
)[0].lstrip("\n")
|
"//td[contains(text(),'発売日:')]/following-sibling::td/text()"
|
||||||
|
)[0].lstrip("\n")
|
||||||
|
except:
|
||||||
|
result = "----"
|
||||||
if result == "----":
|
if result == "----":
|
||||||
try:
|
try:
|
||||||
result = html.xpath(
|
result = html.xpath(
|
||||||
@@ -208,6 +211,7 @@ def main(number):
|
|||||||
"https://www.dmm.co.jp/mono/anime/-/detail/=/cid=",
|
"https://www.dmm.co.jp/mono/anime/-/detail/=/cid=",
|
||||||
"https://www.dmm.co.jp/digital/videoc/-/detail/=/cid=",
|
"https://www.dmm.co.jp/digital/videoc/-/detail/=/cid=",
|
||||||
"https://www.dmm.co.jp/digital/nikkatsu/-/detail/=/cid=",
|
"https://www.dmm.co.jp/digital/nikkatsu/-/detail/=/cid=",
|
||||||
|
"https://www.dmm.co.jp/rental/-/detail/=/cid=",
|
||||||
]
|
]
|
||||||
chosen_url = ""
|
chosen_url = ""
|
||||||
|
|
||||||
@@ -290,3 +294,4 @@ def main_htmlcode(number):
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
print(main("DV-1562"))
|
print(main("DV-1562"))
|
||||||
|
print(main("96fad1217"))
|
||||||
|
|||||||
Reference in New Issue
Block a user