This commit is contained in:
jnozsc
2020-07-25 14:27:24 -07:00
parent 97182f9249
commit 3b79cf31dc

View File

@@ -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"))