如何为多个页面运行grunt-phantomas

时间:2017-06-12 14:31:54

标签: javascript gruntjs phantomjs

如何为多个页面运行grunt-phantomas? 目前我能够在这个grunt任务grunt-phantomas中传递一个URL,我尝试使用谷歌搜索,但没有找到任何支持传递多个页面。

目前我正在使用

# check4newPRs.py import urllib.request ## Read web page contents into webPageCopy variable. url = 'https://www.nwbio.com/press-releases/' response = urllib.request.urlopen(url) webPageCopy = response.read() ## Determining current date; populating month,day and variables import datetime import calendar now = (datetime.datetime.now()) daynmbr = "05" ## temporarily hard-coded the 5th of June, the last press released by comany. Need to remove prior to going live. ## Creating current date search string, used to search webpage. All press releases start with a date in the following format: "June 5, 2017". todaysdate = calendar.month_name[now.month] + " " + daynmbr.lstrip("0") + ", " + str(now.year) ## Remove prior to going live. ##todaysdate = calendar.month_name[now.month] + " " + str(now.day).lstrip("0") + ", " + str(now.year) ##use this one for production print (str(todaysdate)) ## ========================================================================== ## ======== press release is found, send Twilio sms text alert ======== ## ========================================================================== if (todaysdate.encode('utf-8')) in webPageCopy: ## todaysdate must be same byte type as the webPageCopy variable. print ('found new press release dated', todaysdate) import twilio import twilio.rest try: client = twilio.rest.TwilioRestClient(account_sid, auth_token) message = client.messages.create( body="New Northwest Biotherapeutics Press Release Found!!!", to="+1##########", from_="+1##########" ) except twilio.TwilioRestException as e: print (e)

我正在寻找类似的东西:

phantomas: {
            prod: {
                options: {
                    indexPath: './public/phantomas/',
                    options: {
                        'timeout': 30
                    },
                    url: 'http://www.homesofa.de/',
                    buildUi: true
                }
            }
        }

0 个答案:

没有答案