WEBVTT

0
00:00.300 --> 00:01.080
Hey guys,

1
00:01.080 --> 00:05.580
welcome to Day 47 of 100 Days of Code. Today

2
00:05.580 --> 00:09.600
we're going to be building a project that I personally find really useful.

3
00:10.680 --> 00:15.350
It's a Amazon price tracker project.

4
00:15.380 --> 00:17.390
So I don't know about you,

5
00:17.390 --> 00:22.310
but I find it much more time-efficient to go online and search for the thing

6
00:22.310 --> 00:25.580
that I need rather than have to go and browse through the shops,

7
00:25.880 --> 00:30.050
find the thing I want and I just find the whole shopping experience,

8
00:30.050 --> 00:33.170
really tiring. Whereas with buying stuff online,

9
00:33.170 --> 00:36.230
you can simply go on Amazon, type in the thing you want,

10
00:36.470 --> 00:39.470
and then a few days later you'll get it delivered straight to your door.

11
00:40.160 --> 00:44.720
But one of the things I've noticed with online shopping is that the prices of

12
00:44.720 --> 00:49.130
things vary dramatically from day to day. For example,

13
00:49.130 --> 00:53.690
one of the things I've been really tempted to buy is a instant pot.

14
00:53.960 --> 00:57.350
Um, it's basically it like a souped up pressure cooker.

15
00:57.950 --> 01:00.890
It can do all the normal things like cook your rice

16
01:01.190 --> 01:05.660
or work as a slow cooker, or pressure-cook your meat until it's really tender,

17
01:06.230 --> 01:11.230
but it can even do crazy stuff like bake a cake in the pressure cooker or make

18
01:12.980 --> 01:17.150
yogurt. This is something that I've had my eye on for a while,

19
01:17.180 --> 01:21.320
but I haven't really even able to pull the trigger just because I can't really

20
01:21.320 --> 01:26.320
justify paying $120 for something that I can sort of do with the other things

21
01:26.960 --> 01:30.980
I have, right? You can bake a cake with an oven, you can, um,

22
01:31.100 --> 01:32.540
you can make everything on the stove,

23
01:32.990 --> 01:35.420
but it's something that I've really been fascinated by 

24
01:35.420 --> 01:40.040
and I wonder if I could cut down the amount of time I spend cooking so I can do

25
01:40.040 --> 01:43.400
some other things like making Programming tutorials.

26
01:44.000 --> 01:49.000
But one of the things I've noticed about this item or a lot of items on Amazon

27
01:49.100 --> 01:51.650
is that the price really fluctuates.

28
01:52.010 --> 01:55.310
So I've been keeping my eye on this product for a while now

29
01:55.340 --> 01:59.540
and I've seen it go up and down even on a day to day basis sometimes.

30
02:00.080 --> 02:05.080
And there is a really cool website that I discovered called camelcamelcamel.com,

31
02:05.420 --> 02:08.660
where you can simply take a product's URL,

32
02:08.660 --> 02:13.430
so you select the size you want, the style, the item, whatever it may be,

33
02:13.490 --> 02:17.990
and then you take the URL and you paste it into camelcamelcamel.com

34
02:18.440 --> 02:21.350
and it will give you the price history of that 

35
02:21.380 --> 02:22.580
product. isn't that cool?

36
02:22.880 --> 02:27.880
So now you can look and get actual data on how much that product costs over the

37
02:28.790 --> 02:33.560
past few months or year and you can now see what was the lowest price,

38
02:33.860 --> 02:38.210
what was the highest price and see how it just fluctuates almost randomly.

39
02:38.660 --> 02:41.600
Now, normally I would think that on big sale days

40
02:41.660 --> 02:46.370
like black Friday or prime day, that you would get the cheapest price,

41
02:46.730 --> 02:51.020
but actually, that's not always the case. For example, in this case,

42
02:51.020 --> 02:55.400
the cheapest price for this item happened on May 25th,

43
02:55.760 --> 02:58.310
which is, I think, just a normal day.

44
02:58.310 --> 03:01.870
I don't really why it got price-dropped to that amount.

45
03:03.060 --> 03:08.060
So let's say that we have set a price in our mind at which point I'm ready to

46
03:09.150 --> 03:10.920
make a purchase. So for me,

47
03:11.400 --> 03:15.930
maybe if this item drops down from $119

48
03:16.020 --> 03:20.910
um, to let's say $99, then I'll actually buy it.

49
03:21.720 --> 03:24.870
Now we can actually do this using what we've learned,

50
03:25.290 --> 03:30.270
and then on that day, I get an email and it tells me Instant Pot price alert,

51
03:30.330 --> 03:35.250
the product price is now $99.99 below your target price, go ahead and buy now.

52
03:35.850 --> 03:40.350
So this is basically the functionality that we want to build using our knowledge

53
03:40.350 --> 03:42.150
of Python and web scraping.

54
03:42.930 --> 03:47.400
And our Python bot is going to be the one that's going to be constantly checking

55
03:47.400 --> 03:49.710
for the price. And when the time is right,

56
03:49.740 --> 03:53.280
it's going to be the one that's going to alert us, using an email,

57
03:53.460 --> 03:57.900
telling us to buy so that we don't have to spend every day looking at the

58
03:57.900 --> 03:58.440
website,

59
03:58.440 --> 04:02.850
checking the price and doing something that our Python bot could do by itself.

60
04:04.170 --> 04:09.090
The idea here is our little Python body is going to have a set time, let's say 

61
04:09.090 --> 04:13.290
9:00 AM every day where it checks that URL that we got.

62
04:13.740 --> 04:18.000
So it's going to look at a specific thing on that webpage,

63
04:18.030 --> 04:22.290
which is the price. So at the moment, it's right, registering as 

64
04:22.290 --> 04:24.690
$119.99

65
04:25.110 --> 04:30.110
and the moment when it checks that price and it sees 99.9 something,

66
04:31.290 --> 04:34.920
so anything that's below our set target of a hundred dollars,

67
04:35.280 --> 04:39.480
then it's going to send us an email and give us an alert.

68
04:40.440 --> 04:45.000
So then we can go to the URL and purchase is that product.

69
04:45.300 --> 04:47.040
Instead of having to check it out ourselves,

70
04:47.370 --> 04:50.760
we now get notified when our condition is met.

71
04:51.720 --> 04:55.350
As you can imagine, this is going to involve a little bit of web scraping,

72
04:55.500 --> 05:00.500
where we try to get hold of the value of this price and we turn it into a number

73
05:02.250 --> 05:07.230
and we check it against our target price. And then when the conditions are met,

74
05:07.290 --> 05:10.950
then we use the SMTP module to send ourselves an email.

75
05:11.880 --> 05:14.100
So that's the goal of today's project

76
05:14.250 --> 05:18.210
and I think if you're somebody like me who buys a lot of stuff online,

77
05:18.510 --> 05:20.940
then this is going to be pretty interesting for you.

78
05:21.090 --> 05:23.970
And I hope that will actually come in handy at some point as well.

79
05:24.840 --> 05:29.370
So head over to the next lesson and let's get started building our Amazon price

80
05:29.370 --> 05:30.090
tracking bot.