python webbot

Solutions on MaxInterview for python webbot by the best coders in the world

showing results for - "python webbot"
Harrison
12 Sep 2016
1# (A browser I created where you can load a url from the command line)
2# You can take this as your own if you want, it's pretty simple.
3import os
4import webbot
5import time
6import random
7from getkey import *
8
9
10typing_speed = 100 #wpm
11def slowprint(t):
12    for l in t:
13        sys.stdout.write(l)
14        sys.stdout.flush()
15        time.sleep(random.random()*10.0/typing_speed)
16    print ('')
17  
18driver = webbot.Browser()
19driver.go_to('https://google.com')
20
21while True:
22  choice = input('Do you want to load a URL in the browser? (Y or N): ') 
23  if choice == 'Y':
24    CLINK = input('Enter a URL to load in the browser:  ')
25    print
26    slowprint('Loading...')
27    driver.go_to(CLINK)
28    print
29    slowprint('Finished')
30  elif choice == 'N':
31      print('Cancelled.')
32  else:
33      print("You didnt enter Y or N. You entered",'"',choice,'"')
34    
35
36
37        
38      
39      
40