Hi, in this video, I'll show you the solution, which basically is a script that goes to this page,
logs in with username and password and then clicks over to Contact Us, that link.
That's it.
So let's go to Repl and I'm going to fork, to duplicate one of these Repls, and the most similar
one is log in and click.
So fork. On online
Retailer.
So that's the website.
It looks like that.
So the first thing we want to do is provide here the login page, which is.
So let me log out.
And press on that icon, and this is the log in page.
So copy the URL and paste it in there in the driver and then return the driver.
We get the driver and then we find the element, the username.
So this box here has an ID of customer email.
And let's see the password as well since we are here.
So customer email and customer password.
Those two, let me copy that, paste it
here.
So find element by I.D. and... Sorry, customer password.
This one is the name.
This is the I.D. So paste it there.
Now we need to provide the username and password the username was, in my case "app7flask@gmail.com".
So,
it's your email address, which you used to sign up on that website and then the password
is this in my case.
In your case should be your password, and then we press the return key to log in.
Next, we should find.
This X path, so expect that, this one in here, right-click, go to copy.
Copy full x path and paste it in there.
And click it, so dot click and it should be OK, so let's run this script.
Expand a bit more.
Here comes the browser.
Here goes the log in page, the data should be entered in a minute, yeah, in a second.
Right?
And we got a problem, so unable to locate that element.
And that is, let's see up here, line 25.
Right.
So this element was not located.
So let's try to get the x path instead of contact us.
So right click here.
Copy just the x path, sometimes to the full x path works, sometimes just the x path.
So that value there.
Paste and be careful with the quotes.
So maybe we want to use single quotes to wrap this string around since we have this double quotes inside
the x path itself.
So that should be fine.
Yeah, I'm going to run.
Here comes the login page.
Successful this time.
So if I scroll up, you will see that the URL is here.
So driver.currenturl gives us the URL of the contact us page.
So everything worked fine and this is the final code.
Thank you.