File tree Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Expand file tree Collapse file tree 2 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 25
25
form = login_html .form
26
26
form .select ("input" )[0 ]["value" ] = "wrong"
27
27
form .select ("input" )[1 ]["value" ] = "password"
28
- error_page = my_browser .submit (form , login_page .url ) # submit form
28
+ error_page = my_browser .submit (form , login_page .url ) # submit form
29
29
30
30
# check for string
31
31
if error_page .soup .text .find ("Wrong username or password!" ) != - 1 :
32
32
print ("Login Failed." )
33
33
else :
34
- print ("Login Successful." )
34
+ print ("Login Successful." )
Original file line number Diff line number Diff line change 7
7
8
8
# obtain 1 stock quote per minute for the next 3 minutes
9
9
for i in range (0 , 3 ):
10
-
10
+
11
11
page = my_browser .get ("http://finance.yahoo.com/q?s=yhoo" )
12
12
html_text = page .soup
13
-
13
+
14
14
# return a list of all the tags where the id is 'yfs_184_yhoo'
15
15
my_price_tag = html_text .select ("#yfs_l84_yhoo" )
16
16
# take the BeautifulSoup string out of the first tag
23
23
24
24
print ("The price of YHOO is: {} on {}" .format (my_price , my_time ))
25
25
26
- if i < 2 : # wait a minute if this isn't the last request
27
- sleep (60 )
26
+ if i < 2 : # wait a minute if this isn't the last request
27
+ sleep (60 )
You can’t perform that action at this time.
0 commit comments