Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions opac_catch2.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def next(cls):#インスタンスのカウント
def extract_data(self,data):
#リンクの抽出
tmp = data.split("""','1');"><strong>""")
book_link = 'https://opac.icu.ac.jp' + tmp[0]
book_link = f'https://opac.icu.ac.jp{tmp[0]}'
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Book_data.extract_data refactored with the following changes:

#書籍名の抽出
tmp2 = tmp[1].split('</strong>',1)
tmp3 = tmp2[0].split('/',1)
Expand All @@ -33,9 +33,9 @@ def show_info(self):
print('Name:', self.name)
print('Link:', self.link)
def write_file(self,file):
file.write('No:'+str(self.no)+'\n')
file.write('Name:'+self.name+'\n')
file.write('Link:'+self.link+'\n')
file.write(f'No:{str(self.no)}' + '\n')
file.write(f'Name:{self.name}' + '\n')
file.write(f'Link:{self.link}' + '\n')
Comment on lines -36 to +38
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Function Book_data.write_file refactored with the following changes:

file.write('\n')

#ドライバーの場所、ドライバーは各々でダウンロードして用意
Expand Down