This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import requests | |
| from bs4 import BeautifulSoup | |
| leads = [] | |
| rates = [] | |
| for i in range(3): | |
| url = "https://www.greatschools.org/virginia/manassas/prince-william-county-public-schools/schools/?page={}".format(i) | |
| r = requests.get(url, headers={'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36'}) | |
| soup = BeautifulSoup(r.text, 'lxml') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| ### The only change I made was to add {}".format(i) so that python new to substitute each i into the string! | |
| import requests | |
| from bs4 import BeautifulSoup | |
| for i in range(93): | |
| url = "https://www.greatschools.org/virginia/manassas/prince-william-county-public-schools/schools/?page={}".format(i) | |
| r = requests.get(url, headers={'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/55.0.2883.95 Safari/537.36'}) | |
| soup = BeautifulSoup(r.text, 'lxml') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function HTTPResponse( uri ) | |
| { | |
| var response_code ; | |
| try { | |
| response_code = UrlFetchApp .fetch( uri ) .getResponseCode() .toString() ; | |
| } | |
| catch( error ) { | |
| response_code = error .toString() .match( / returned code (\d\d\d)\./ )[1] ; | |
| } | |
| finally { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import spacy | |
| import codecs | |
| nlp = spacy.load('en') | |
| ## Include the file name below ## | |
| multiSentence = codecs.open( | |
| "kam_li.txt", 'r', encoding='ascii', errors='ignore').read() | |
| doc = nlp(multiSentence.decode('utf-8')) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import logging | |
| from flask import Flask, render_template | |
| from flask_ask import Ask, statement, question, session | |
| app = Flask(__name__) | |
| ask = Ask(app, "/") | |
| logging.getLogger("flask_ask").setLevel(logging.DEBUG) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| booking_button = browser.find_element_by_xpath("//a[contains(.,'Make a booking ($0.00) ')]").click() | |
| save_button = browser.find_element_by_xpath("//*[@id='modal_booking']/form") | |
| t.sleep(5) | |
| save_button.submit() | |
| print save_button.submit() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| end_time.send_keys(end_time_of_room) | |
| begin_time.send_keys(begin_time_of_room) | |
| t.sleep(5) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from datetime import datetime as dt | |
| begin_time_of_room = str(hq_date) + ' ' + '-' + ' ' + str(current_hour) + ":" + str(time) + ' ' + str(period) | |
| end_time_of_room = str(hq_date) + ' ' + '-' + ' ' + str(end_hour) + ":" + str(time) + ' ' + str(period) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from datetime import datetime as dt | |
| hour = dt.now().hour | |
| for i in str(hour): | |
| if hour < 12 and time != '00': | |
| current_hour = hour | |
| end_hour = current_hour + 1 | |
| period = "AM" | |
| elif hour < 12 and time == '00': |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from datetime import datetime as dt | |
| minute = dt.now().minute | |
| if minute <= 60: | |
| if minute <=15: | |
| time = 15 | |
| elif minute <=30: | |
| time = 30 | |
| elif minute <=45: |