Skip to content

Commit 7c50ab2

Browse files
authored
Merge pull request #66 from livia-macon/Adjust_the_print_pdf_method
Replacing title characters
2 parents d8da757 + df9d891 commit 7c50ab2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

botcity/web/bot.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import os
88
import platform
99
import random
10+
import re
1011
import shutil
1112
import time
1213
from typing import List
@@ -1066,6 +1067,7 @@ def print_pdf(self, path=None, print_options=None):
10661067
str: the saved file path
10671068
"""
10681069
title = self.page_title() or "document"
1070+
title = re.sub("[\\\\|/:–]", "", title)
10691071
timeout = 60000
10701072
default_path = os.path.expanduser(os.path.join(self.download_folder_path, f"{title}.pdf"))
10711073

0 commit comments

Comments
 (0)