-
Jan 2nd, 2021, 11:49 AM
#1
Thread Starter
New Member
I can not login to the site
Hi everybody
I cannot login with the codes on the site below. (location country: turkey)
https://www.trendyol.com/giris?cb
It looks like data is being written onto the combobox. but in reality it is absolutely not so. But when you type the mail and password manually, it logs in.
Code:
document.querySelector("#login-email").value="trytrytry@gmail.com"
Code:
document.querySelector("#login-password-input").value="passtrytry1"
Code:
document.querySelector('button[type=submit]').click()
username and password are not real
Last edited by sertokus; Jan 2nd, 2021 at 02:50 PM.
-
Jan 2nd, 2021, 12:15 PM
#2
Re: I can not login to the site
They have a supported API at https://developers.trendyol.com/tr - why don't you use the API rather than trying to automate the webpage? Scraping HTML is always problematic, always likely to break when the designers change things and is likely to be completely unsupported by the website anyway. A lot of websites even prohibit automating the HTML in their T&Cs, not sure on that one as I can't find them in English.
-
Jan 3rd, 2021, 11:22 AM
#3
Thread Starter
New Member
Re: I can not login to the site
thanks for answer @PlausiblyDamp . i have a lot af account. i have some coupons in this account. but i didnt found coupons API on this site https://developers.trendyol.com/tr
I have to login to all my accounts one by one. and i have to check my coupons. My aim is to be able to login without using the sendkey command. I want to run my program in the background. Sendkey is preventing me from running my program in the background
-
Jan 3rd, 2021, 12:51 PM
#4
Re: I can not login to the site
You should recognize why sites try to prevent exactly what you are doing. While you are a member, what if you were not? The majority of visitors to most sites are probably not people, but bots. Lots of sites go to great lengths to make it VERY hard or even impossible to do any web scraping, because they don't know who is on the other end. That's almost certainly what you are running into. The API is supplied as a means to get access without trying to automate the web page, and the fact that they have one means that this is something they are clearly thinking about.
I didn't see any explicit TOS on the site, though I also didn't look very far. Lots of sites explicitly state that you are not to use automated means to login, in which case this site doesn't support doing so, either. Even if the site doesn't explicitly state that, a bit of reading of the link that Plausibly Damp supplied shows that you should expect that.
The ultimate problem with web scraping is that sites can change their layout rapidly, so any solution will break at a moments notice. In this case, the site has posted that they made changes in January and will be making another significant change in February, with more likely to follow. Whatever solution you can get working is probably only going to last for a few weeks, then fail again. That's the nature of the web. Automating through a page is fairly hopeless with a target that is moving as quickly as that site. APIs are provided (usually) to give you a stable interaction. For that site, even their API is a moving target.
Normally, I would suggest getting in touch with the site, as they likely want you to interact with them and would be interested in helping out. With that site....I'm not so sure.
My usual boring signature: Nothing
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|