Python Selenium Tutorial #4 - ActionChains & Automating Cookie Clicker!

Python Selenium Tutorial #4 - ActionChains & Automating Cookie Clicker!

Tech With Tim

4 года назад

218,458 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Preeti Rani
Preeti Rani - 31.10.2023 23:32

what will be the css_selector for <a href title='Next> <<</a>

Ответить
NorthStar
NorthStar - 11.09.2023 17:20

what if the website requires to be logged in , is this gonna work in selenium , or u can perform login with selenium for a web page

Ответить
Andrey Andreyovich
Andrey Andreyovich - 30.07.2023 12:01

it seems he doesnt kbow too good Selenium. I don't recommend to follow this

Ответить
Shlumpy
Shlumpy - 29.05.2023 17:36

LIKE

Ответить
Mind Teaser Hub
Mind Teaser Hub - 30.04.2023 00:02

Hey Tim, Thank you so much for the tutorial!

Ответить
Faisal Aziz
Faisal Aziz - 24.01.2023 21:08

How to by-pass language tab, how to select English in this program. ?

Ответить
ALAN FUNG
ALAN FUNG - 03.01.2023 17:05

HI, Sir. I run the same code, but it raises staleelementreferenceexception for the actions.perform( ) command, and sometimes it just click the cookie once. What is the reason? Thanks

Ответить
Seth Watson
Seth Watson - 02.12.2022 12:38

Hmm this one didn't work well for me. There's a language selector now and I was able to click English, then I got StaleElementReferenceException which I was able to work around. Then it was only clicking the cookie one time. I appreciate the tutorial, imo it would've been better with a real world example instead of clicking a cookie... Oh well, onto the next one!

Ответить
David
David - 28.11.2022 08:16

is anyone else unable to open this site with selenium? I get connection refused

Ответить
John B
John B - 14.10.2022 19:04

I am trying to follow this, but when my browser opens the page I have to select a language, got that sorted, but now I can't figure out how to have it start clicking on the cookie. Any ideas?

Ответить
Daniel Lubenov
Daniel Lubenov - 14.10.2022 11:47

Very nice tutorial. Useful thing would be to add some random sleep (0.1-0.3 sec) between clicks against detection.

Ответить
Josip Pardon
Josip Pardon - 26.09.2022 20:10

ActionChains clicking is acctualy very slow. Much faster clicking is achieved without it:

for i in range(5000):
cookie.click()
count = int(cookie_count.text.split(" ")[0])
print(count)
for item in items:
value = int(item.text)
if value <= count:
item.click()

Ответить
Hao Jie Chan
Hao Jie Chan - 11.09.2022 08:33

got hooked onto the game instead 🤣

Ответить
Shweta Sawant
Shweta Sawant - 06.08.2022 00:14

Need help copy data from excel and search into site and then again copy search results from sote and then copy and paste back to excel in perticular column

Ответить
Paula Torres Higuera
Paula Torres Higuera - 22.07.2022 23:01

it only clicks the cookie once :(

Ответить
Yunshun Zhong
Yunshun Zhong - 02.06.2022 18:20

Thank you! I wonder how can I speed up the clicking? Like clicking 100 times a second

Ответить
Hex
Hex - 02.04.2022 09:00

that's cool bro

Ответить
jiri dofek
jiri dofek - 19.01.2022 15:13

I have a problem. Command perform() just ignores the for i in range(5000). It runes chain just one time. MacBook.

Ответить
Naijarianman
Naijarianman - 23.12.2021 16:58

Aren't action chains basically performing the same role as declaring a function?

Ответить
Karim Eino
Karim Eino - 08.12.2021 20:04

Thanks a lot Tim for the easy way, i have something really weird, when I use this part of the code

actions = ActionChains(browser)
actions.click(cookie)

for i in range(1000):

actions.perform()

it perform only 1 click

when i change it to

for i in range(1000):
actions = ActionChains(browser)
actions.click(cookie)
actions.perform()

it works great, dose any one can help in that?

Ответить
Javier Leon
Javier Leon - 25.11.2021 03:38

help, when I try item.text the program give me this error: AttributeError: 'list' object has no attribute 'text'
how can I fix it????

Ответить
GG Gang
GG Gang - 19.11.2021 11:13

Hopefully you will come back to this series one day :/

Ответить
zainab ziani
zainab ziani - 13.11.2021 15:44

Is the try block and implicitly_wait function the same? can we just alternate between them?

Ответить
rizal bayu
rizal bayu - 01.11.2021 20:15

Bro pliss help when i run i got error cann't import name Action Chains

Ответить
טוביה יגלניק
טוביה יגלניק - 14.10.2021 12:13

You are good, bro

Ответить
Freshness_Of_Air
Freshness_Of_Air - 05.10.2021 06:44

how can i make it click faster?

Ответить
Samuel Chan
Samuel Chan - 01.10.2021 17:01

Sitting through your Ads, cos you deserve it!!

Ответить
Olaf Verburg
Olaf Verburg - 26.09.2021 03:35

Hey, im trying this out and i want to make the price list become longer as more items are unlocked anybody got a hint for this

Ответить
General220
General220 - 19.08.2021 15:41

I have a question, so as you said i may get IP banned. Can I use a proxy to avoid that?

Also, let's say I live Europe and I wanna bot a website that's based in the US. Do I need to use a server to speed up the process, (with the proxy to change my ip) for example AWS or Google cloud or whatever? Or is the proxy sufficient?

Ответить
Devansh: Machine Learning Made Simple
Devansh: Machine Learning Made Simple - 12.08.2021 19:47

Funny that Tim shows his hands off the mouse, but never his feet. He's definitely just using feet mouse

Ответить
גיא־רפאל כהן
גיא־רפאל כהן - 04.08.2021 14:22

did not work for me :(
I did all the previous lessons and had success.
this one did not go (not even the first part)

Ответить
Saksham Rai
Saksham Rai - 30.07.2021 12:47

91.981 trillion cookies baby

Ответить
Saksham Rai
Saksham Rai - 30.07.2021 09:54

selenium.common.exceptions.WebDriverException: Message: disconnected: received Inspector.detached event

Looks like they have some security check in cookieclicker now

Ответить
miss_tech
miss_tech - 28.07.2021 23:30

this tutorial is hard to be applicable in other projects , not very useful

Ответить
Khaidahx
Khaidahx - 26.06.2021 14:37

Thanks for the video, very helpful for a beginner like me. I'd like to ask, though, is there any chance for the clicks to be faster? Even my grandma can click faster than this (pun intended). I've been googling for a while and couldn't find anything helpful on the topic.

Ответить
SASIN NISAR83
SASIN NISAR83 - 06.06.2021 18:51

You got error because it was 3,240 something and not 3240

Ответить
Hector Flores Pauner
Hector Flores Pauner - 03.06.2021 04:57

you don't need the sentence move_to_element, if you say directly upgrade_actions.click(item) it works just fine... And you have another mistake, when checking if the cookie_count value es greater than some upgrade, as it loops over the two items it buys the cheapest always and never gets to the most expensive, regardless the position in the list, but as you said, this tutorial was not about making a perfect cookie clicker script, it was to show us the functioning of the ActionChains, and that I must say you did indeed sir, great video

Ответить
Ignacio Leikis
Ignacio Leikis - 02.06.2021 03:16

How do other websites detect bots?
How easily can other websites detect a bot?
Just discovered your channel, BIG thumbs up!

Ответить
Baltazar Kun
Baltazar Kun - 31.05.2021 22:36

"if we have a 100 cookies, I'd like to do grandma"

Ответить
Chris C.
Chris C. - 27.05.2021 17:32

Damn. I wanted to use Selenium to automate a survey I have to fill out every morning before entering work. But your comment about being banned put me off, lol.

Ответить
PianoPianist
PianoPianist - 19.05.2021 20:29

This doesn't work, whenever the cookie_count is over 23, it upgrades the cursor, and thus you can never reach 100.

Ответить
Khushaal Nandwani
Khushaal Nandwani - 14.05.2021 08:50

you explain so well! and all the things you taught I can implement in my project which i find rare (me being a beginner), thanks a lot man. Respect.

Ответить
M. Fatih Yıldız
M. Fatih Yıldız - 11.05.2021 16:11

i got AttributeError(“move_to requires a WebElement”) AttributeError: move_to requires a WebElement error when i run this code. I could fix it with a lil help from stackoverflow but why you didnt get this error?

Ответить
Sarmita Majumdar
Sarmita Majumdar - 09.05.2021 18:56

Just am in love with your style of teaching and materials!!! Amazing!!! Wow...!!!

Ответить
Chirosmit
Chirosmit - 06.05.2021 11:46

"like to do Grandma!!!"
-Tim
LOL!!!!!

Ответить
Ricardo Björkeheim
Ricardo Björkeheim - 04.05.2021 22:11

I got a lot of errors and it does not work

Ответить
Ralph Burgchomp
Ralph Burgchomp - 02.05.2021 03:22

Thanks for the great vids.

Ответить
Ali Samie
Ali Samie - 16.04.2021 13:53

Hi Tim, i just realized that using an opened browser from command line(using a .bat file) makes selenium much faster on low end computers like mine. i would like to share some videos later just like you

Ответить