def Launch():
"""
Launch the Medium bot and ask the user what browser they want to use.
"""
if 'chrome' not in DRIVER.lower() and 'firefox' not in DRIVER.lower() and 'phantomjs' not in DRIVER.lower():
# Browser choice
print 'Choose your browser:'
print '[1] Chrome'
print '[2] Firefox/Iceweasel'
print '[3] PhantomJS'
while True:
try:
browserChoice = int(raw_input('Choice? '))
except ValueError:
print 'Invalid choice.',
else:
if browserChoice not in [1,2,3]:
print 'Invalid choice.',
else:
break
StartBrowser(browserChoice)
elif 'chrome' in DRIVER.lower():
StartBrowser(1)
elif 'firefox' in DRIVER.lower():
StartBrowser(2)
elif 'phantomjs' in DRIVER.lower():
StartBrowser(3)
评论列表
文章目录