updating scraper to quit browser when finished
This commit is contained in:
@@ -11,7 +11,7 @@ seedNum = 27
|
|||||||
""" Simulation parameters """
|
""" Simulation parameters """
|
||||||
# Should we simulate more than once?
|
# Should we simulate more than once?
|
||||||
setSim = True
|
setSim = True
|
||||||
simNum = 5000
|
simNum = 15000
|
||||||
|
|
||||||
""" Define our data """
|
""" Define our data """
|
||||||
# The Statespace
|
# The Statespace
|
||||||
@@ -33,7 +33,7 @@ transitionMatrix = np.array([[0.6, 0.1, 0.3],
|
|||||||
initial_dist = np.array([1, 0, 0])
|
initial_dist = np.array([1, 0, 0])
|
||||||
|
|
||||||
# Steps to run - How many steps or jumps we want the markov chain to make
|
# Steps to run - How many steps or jumps we want the markov chain to make
|
||||||
stepTime = 1
|
stepTime = 2
|
||||||
# End state you want to find probabilites of - we can estimate the stationary
|
# End state you want to find probabilites of - we can estimate the stationary
|
||||||
# distribution by running this many times for many steps.
|
# distribution by running this many times for many steps.
|
||||||
# E.g to find the stat distribution for L run the simulation 10,000 times
|
# E.g to find the stat distribution for L run the simulation 10,000 times
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import emoji
|
|||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
import re
|
import re
|
||||||
|
|
||||||
url = 'https://www.trafficdelays.co.uk/a14-traffic-delays/'
|
url = 'https://www.trafficdelays.co.uk/m62-traffic-delays/'
|
||||||
# prepare the option for the chrome driver
|
# prepare the option for the chrome driver
|
||||||
options = webdriver.ChromeOptions()
|
options = webdriver.ChromeOptions()
|
||||||
options.add_argument('headless')
|
options.add_argument('headless')
|
||||||
@@ -66,3 +66,5 @@ print(f'Hey Andy, maybe flying would be quicker?'
|
|||||||
+ emoji.emojize(f' :helicopter:', use_aliases=True))
|
+ emoji.emojize(f' :helicopter:', use_aliases=True))
|
||||||
print(f'Don\'t fret, he can always work from home!'
|
print(f'Don\'t fret, he can always work from home!'
|
||||||
+ emoji.emojize(f' :house_with_garden:', use_aliases=True))
|
+ emoji.emojize(f' :house_with_garden:', use_aliases=True))
|
||||||
|
|
||||||
|
browser.quit()
|
||||||
|
|||||||
Reference in New Issue
Block a user