1
00:00:00,270 --> 00:00:07,500
Hi, in this video, I'll show you the solution, which basically is a script that goes to this page,

2
00:00:07,630 --> 00:00:13,440
logs in with username and password and then clicks over to Contact Us, that link.

3
00:00:13,560 --> 00:00:14,010
That's it.

4
00:00:14,580 --> 00:00:22,410
So let's go to Repl and I'm going to fork, to duplicate one of these Repls, and the most similar

5
00:00:22,410 --> 00:00:25,860
one is log in and click.

6
00:00:27,050 --> 00:00:29,570
So fork. On online

7
00:00:31,790 --> 00:00:32,570
Retailer.

8
00:00:33,170 --> 00:00:34,760
So that's the website.

9
00:00:35,540 --> 00:00:36,470
It looks like that.

10
00:00:37,550 --> 00:00:43,280
So the first thing we want to do is provide here the login page, which is.

11
00:00:44,970 --> 00:00:45,990
So let me log out.

12
00:00:48,740 --> 00:00:51,800
And press on that icon, and this is the log in page.

13
00:00:52,040 --> 00:00:59,240
So copy the URL and paste it in there in the driver and then return the driver.

14
00:00:59,510 --> 00:01:04,370
We get the driver and then we find the element, the username.

15
00:01:05,150 --> 00:01:14,360
So this box here has an ID of customer email.

16
00:01:14,690 --> 00:01:17,870
And let's see the password as well since we are here.

17
00:01:18,410 --> 00:01:21,080
So customer email and customer password.

18
00:01:21,350 --> 00:01:24,800
Those two, let me copy that, paste it

19
00:01:24,800 --> 00:01:25,280
here.

20
00:01:25,280 --> 00:01:32,570
So find element by I.D. and... Sorry, customer password.

21
00:01:32,870 --> 00:01:34,060
This one is the name.

22
00:01:34,070 --> 00:01:37,730
This is the I.D. So paste it there.

23
00:01:40,500 --> 00:01:48,870
Now we need to provide the username and password the username was, in my case "app7flask@gmail.com".

24
00:01:48,870 --> 00:01:49,290
So,

25
00:01:49,300 --> 00:01:55,440
it's your email address, which you used to sign up on that website and then the password

26
00:01:55,470 --> 00:01:57,090
is this in my case.

27
00:01:57,750 --> 00:02:05,670
In your case should be your password, and then we press the return key to log in.

28
00:02:06,360 --> 00:02:08,370
Next, we should find.

29
00:02:10,100 --> 00:02:19,820
This X path, so expect that, this one in here, right-click, go to copy.

30
00:02:20,430 --> 00:02:25,670
Copy full x path and paste it in there.

31
00:02:27,090 --> 00:02:33,330
And click it, so dot click and it should be OK, so let's run this script.

32
00:02:37,770 --> 00:02:39,240
Expand a bit more.

33
00:02:44,010 --> 00:02:45,540
Here comes the browser.

34
00:02:47,370 --> 00:02:54,000
Here goes the log in page, the data should be entered in a minute, yeah, in a second.

35
00:02:54,630 --> 00:02:54,990
Right?

36
00:02:56,310 --> 00:03:01,420
And we got a problem, so unable to locate that element.

37
00:03:02,100 --> 00:03:06,630
And that is, let's see up here, line 25.

38
00:03:07,140 --> 00:03:07,490
Right.

39
00:03:08,430 --> 00:03:11,700
So this element was not located.

40
00:03:12,300 --> 00:03:16,530
So let's try to get the x path instead of contact us.

41
00:03:17,190 --> 00:03:18,690
So right click here.

42
00:03:19,230 --> 00:03:25,740
Copy just the x path, sometimes to the full x path works, sometimes just the x path.

43
00:03:26,190 --> 00:03:28,680
So that value there.

44
00:03:29,100 --> 00:03:32,640
Paste and be careful with the quotes.

45
00:03:33,420 --> 00:03:40,830
So maybe we want to use single quotes to wrap this string around since we have this double quotes inside

46
00:03:40,830 --> 00:03:42,480
the x path itself.

47
00:03:42,780 --> 00:03:44,310
So that should be fine.

48
00:03:44,890 --> 00:03:46,200
Yeah, I'm going to run.

49
00:03:50,440 --> 00:03:52,180
Here comes the login page.

50
00:03:53,750 --> 00:03:54,860
Successful this time.

51
00:03:55,490 --> 00:03:59,840
So if I scroll up, you will see that the URL is here.

52
00:04:00,080 --> 00:04:07,160
So driver.currenturl gives us the URL of the contact us page.

53
00:04:07,460 --> 00:04:11,060
So everything worked fine and this is the final code.

54
00:04:12,290 --> 00:04:12,770
Thank you.

