File tree 3 files changed +35
-0
lines changed
3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change
1
+ import requests
2
+ from bs4 import BeautifulSoup
3
+
4
+ url = "https://www.nytimes.com/"
5
+
6
+ get_url = requests .get (url )
7
+
8
+ soup = BeautifulSoup (get_url .text ,'lxml' )
9
+
10
+ # print(soup.prettify())
11
+ print (soup .title )
12
+
13
+ #d =soup.find_all('div',class_="css-1j836f9 esl82me3")
14
+ print (soup .find ('div' , attrs = {'class' : 'balancedHeadline' }))
15
+ #print(d.text)
Original file line number Diff line number Diff line change
1
+ #Calculate the number of days between two dates
2
+
3
+ from datetime import date
4
+
5
+ print ("Enter the starting date(yy/mm/dd)" )
6
+ f_y = int (input ())
7
+ f_m = int (input ())
8
+ f_d = int (input ())
9
+
10
+ print ("Enter the starting date(yy/mm/dd)" )
11
+ l_y = int (input ())
12
+ l_m = int (input ())
13
+ l_d = int (input ())
14
+
15
+ f_date = date (f_y ,f_m ,f_d )
16
+ l_date = date (l_y ,l_m ,l_d )
17
+
18
+ delta = l_date - f_date
19
+
20
+ print ("The number of days between thr dates is: " ,delta )
You can’t perform that action at this time.
0 commit comments