Skip to content

Commit

Permalink
Fixed title parsing error.
Browse files Browse the repository at this point in the history
  • Loading branch information
ch010060 committed Dec 21, 2021
1 parent b59b900 commit 4fb90a8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion dlsite_renamer-cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ def match_code(code):
# 在python中, 對get請求返回的r.content做fromstring()處理, 可以方便進行後續的xpath()定位等
tree = html.fromstring(r.content)
img_url = tree.xpath('//meta[@name="twitter:image:src"]/@content')[0]
title = tree.xpath('//a[@itemprop="url"]/text()')[0]
title = tree.xpath('//h1[@id="work_name"]/text()')[0]
circle = tree.xpath(
'//span[@itemprop="brand" and @class="maker_name"]/*/text()')[0]
cvList = tree.xpath(
Expand Down
2 changes: 1 addition & 1 deletion dlsite_renamer.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ def match_code(code):
# 在python中, 對get請求返回的r.content做fromstring()處理, 可以方便進行後續的xpath()定位等
tree = html.fromstring(r.content)
img_url = tree.xpath('//meta[@name="twitter:image:src"]/@content')[0]
title = tree.xpath('//a[@itemprop="url"]/text()')[0]
title = tree.xpath('//h1[@id="work_name"]/text()')[0]
circle = tree.xpath(
'//span[@itemprop="brand" and @class="maker_name"]/*/text()')[0]
cvList = tree.xpath(
Expand Down

0 comments on commit 4fb90a8

Please sign in to comment.