1
00:00:00,120 --> 00:00:01,800
Here is an exercise for you.

2
00:00:02,040 --> 00:00:12,210
Your task is to create a script which scrapes this value here on the web page, and it does that every

3
00:00:12,210 --> 00:00:16,290
two seconds and it saves each file in a text file.

4
00:00:17,820 --> 00:00:22,110
So notice that I'm on a Web page here, so I'm not logged in.

5
00:00:22,620 --> 00:00:23,940
You see, this is the home page.

6
00:00:25,040 --> 00:00:30,530
So the outputs should look something like this. Let me fork this.

7
00:00:30,890 --> 00:00:32,240
I'm not going to show you the code.

8
00:00:32,509 --> 00:00:40,910
So let's say scrape dynamic values and save to Files or to File.

9
00:00:41,030 --> 00:00:43,100
So each value in one file.

10
00:00:45,880 --> 00:00:53,560
So you should write a script that if you run that script, then every two seconds one text file should

11
00:00:53,560 --> 00:00:56,050
be generated here in the file directory.

12
00:00:56,440 --> 00:01:04,090
The name of each text file is going to reflect the current date time.

13
00:01:04,269 --> 00:01:06,440
So, for example, it would be something like this.

14
00:01:06,460 --> 00:01:09,910
Let's suppose the time now is 2022.

15
00:01:10,180 --> 00:01:17,110
Let's say is, let's say it's February and 10th of February and maybe a dot..

16
00:01:17,650 --> 00:01:19,080
And then you have the hour.

17
00:01:19,090 --> 00:01:25,120
So let's say it's 14 now in the afternoon and then a dash again.

18
00:01:25,150 --> 00:01:27,550
The minutes, let's say it's 33.

19
00:01:28,000 --> 00:01:31,390
And the seconds, let's suppose, is 59.

20
00:01:32,080 --> 00:01:33,430
dot txt.

21
00:01:33,850 --> 00:01:39,480
So the script would generate that file, and inside this file would be the current temperature,

22
00:01:39,490 --> 00:01:40,690
let's say, 23.

23
00:01:40,960 --> 00:01:43,840
Then, after two seconds, another file would be generated.

24
00:01:46,570 --> 00:01:51,490
The name of that other file would be similar to this, so 2022-2-10-14

25
00:01:53,770 --> 00:01:59,860
and than it would be something like two seconds after the first one, which is, in this

26
00:01:59,860 --> 00:02:04,870
case, 34 minutes and zero three seconds dot txt.

27
00:02:05,050 --> 00:02:09,190
So three seconds after the first one, you see, every two seconds

28
00:02:09,280 --> 00:02:13,420
this would have the current value, maybe 25 and so on.

29
00:02:14,170 --> 00:02:21,430
So you get the idea the scripts should be running continuously, scraping and generating text files

30
00:02:21,430 --> 00:02:22,360
every two seconds.

31
00:02:22,930 --> 00:02:24,190
Good luck with your task.

