File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ public static void GetTitleRange()
34
34
Console . ForegroundColor = ConsoleColor . White ;
35
35
}
36
36
37
- public static string GetEpisodeHtml ( int episodeNumber , string url = null )
37
+ public static string GetEpisodeHtml ( int episodeNumber , string url = null )
38
38
{
39
39
if ( string . IsNullOrEmpty ( url ) )
40
40
{
Original file line number Diff line number Diff line change 1
1
from colorama import Fore
2
2
import httpx
3
3
import bs4
4
+ import datetime
4
5
5
6
6
7
def main ():
7
- print ("Using Python packages " )
8
+ print ("Python async web scraper " )
8
9
10
+ t0 = datetime .datetime .now ()
9
11
get_titles ()
12
+ dt = datetime .datetime .now () - t0
13
+ print (f"Finished in { dt .total_seconds ():,.2f} seconds." )
10
14
11
15
12
16
def get_html (n : int ) -> str :
@@ -31,7 +35,7 @@ def get_title_from_html(n: int, html: str) -> str:
31
35
32
36
33
37
def get_titles ():
34
- for n in range (220 , 230 ):
38
+ for n in range (220 , 231 ):
35
39
html = get_html (n )
36
40
title = get_title_from_html (n , html )
37
41
print (Fore .GREEN + title )
You can’t perform that action at this time.
0 commit comments