From 60ccd6c8661d6f150a6166b1719f897368885a6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pedro=20S=C3=A1=20Couto?= Date: Mon, 27 May 2019 13:44:15 +0200 Subject: [PATCH] ok --- selenium_jstor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/selenium_jstor.py b/selenium_jstor.py index 95d2e3c..891bb82 100644 --- a/selenium_jstor.py +++ b/selenium_jstor.py @@ -16,6 +16,8 @@ while True: # URL iterates through the sequence number url = ("https://www.jstor.org/stable/23267102?Search=yes&resultItemClick=true&searchText=tea&searchUri=%2Faction%2FdoBasicSearch%3FQuery%3Dtea%26amp%3Bacc%3Don%26amp%3Bfc%3Doff%26amp%3Bwc%3Don%26amp%3Bgroup%3Dnone&ab_segments=0%2Fl2b-basic-1%2Frelevance_config_with_tbsub_l2b&refreqid=search%3A9fd0deff8d3258de87d3b54d6dfad664&" + "seq=%i#metadata_info_tab_contents"%i) + name = (input("How do you want to call you files? ")) + # Tell Selenium to open a new Firefox session # and specify the path to the driver driver = webdriver.Firefox(executable_path=os.path.dirname(os.path.realpath(__file__)) + '/geckodriver') @@ -38,7 +40,7 @@ while True: imgdata = base64.b64decode(base64String) # save the image - filename = ('page%i.gif'%i) + filename = (name + '%i.gif'%i) with open(filename, 'wb') as f: f.write(imgdata)