File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change
1
+ import bs4
2
+ import requests
3
+ from bs4 import BeautifulSoup
4
+ urls = []
5
+ URL = requests .get ("https://www.livecoinwatch.com" )
6
+ parsedText = bs4 .BeautifulSoup (URL .text ,"lxml" )
7
+ for i in parsedText .find_all ("a" ,href = True ):
8
+ urls .append ("https://www.livecoinwatch.com" + str (i ["href" ]))
9
+ urls = urls [17 :67 ]
10
+ def getPrice (url ):
11
+ URL1 = requests .get (url )
12
+
13
+ parsedTextFinal = bs4 .BeautifulSoup (URL1 .text ,"lxml" )
14
+
15
+ name = parsedTextFinal .find_all ("div" ,{"class" :"mr20" })[0 ].find ("h1" ).text
16
+
17
+ s_name = parsedTextFinal .find_all ("div" ,{"class" :"mr20" })[0 ].find ("p" ).text
18
+
19
+ price = parsedTextFinal .find_all ("div" ,{"class" :"cion-item coin-price-large ml20 px-0" })[0 ].find ("span" ).text
20
+
21
+ capital = parsedTextFinal .find_all ("div" ,{"class" :"cion-item text-left" })[0 ].find ("span" ).text
22
+
23
+ volume = parsedTextFinal .find_all ("div" ,{"class" :"cion-item text-left" })[0 ].find ("span" ).text
24
+
25
+ liquidity = parsedTextFinal .find_all ("div" ,{"class" :"cion-item col-md-4 col-xl-3 px-1 py-1 py-md-0" })[0 ].find ("span" ).text
26
+
27
+ growth = parsedTextFinal .find_all ("div" ,{"class" :"cion-item px-1 grow" })[0 ].find ("span" ).text
28
+
29
+ print ("{name:" + str (name )+ " shortname:" + str (s_name )+ " price:" + str (price )+ " capital:" + str (capital )+ " volume:" + str (volume )+ " liquidity:" + str (liquidity )+ " growth:" + str (growth )+ " }" )
30
+
31
+ while True :
32
+ for i in urls :
33
+ getPrice (i )
You can’t perform that action at this time.
0 commit comments