I believe the explanation of implicit wait at 5:44 is incorrect. You say the line will not be passed for 5 seconds but I believe what is actually happening is you are setting a global setting to wait up to 5 seconds whenever anything you are are looking for does not yet exist. Great videos, thanks for making them!
@@Sk_-vu6dv Let's imagine you are playing a click game on a website (the most number of kills win), if you use selenium you will get banned because the website can detect a use of bot. But pyautogui module sends key inputs, mouse presses making it seem that there is no bot running but a normal user is sending those clicks. Thus, you will break the game.
Yes pyautogui works really well. If you are trying to make a bot that runs on your computer, then pyautogui is definitely the way to go. I use selenium for off computer navigating where you want it to run on a server.
that was pretty straight forward for you to say "For any of my tut, i simply go through the docs itself" ik you meant the brush up before every tut but still. Anyway I really liked your tuts -simple, easy and precise.
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
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
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?
The video was really good as always. Just a suggestion: don't use implicitly wait. Instead you can use explicitly wait which allows the browser to wait until a certain condition occurs (selenium-python.readthedocs.io/waits.html). Sorry for the bad english.
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
Hey man not sure if you read the comments but just from these 4 videos I automated checking a website if someone had cancelled their appointment and to text me if that appointment is sooner than the existing available date.
you could've created and stored the actions in a list beforehand(as there are only a few) and just call them in the "for I in range(5000)" instead of creating them over and over again.
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?
Line 14, i'm getting an error 'no such element: unable to locate element'. I typed "productPrice" as Tim did. The actual element ID is 'product price 0' but why isn't it typed as such?
what's the difference between waiting with implicite wait or time.sleep() ? in both cases we won't pass that line until that duration we specified is over and the website is opened
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?
Hi Tim, great video. I don't understand the purpose of action chains, how is using them different from writing a regular function with all the things i want the web element to do?
Idk if you still need it but what he put should upgrade the farther ones as well. It’s just counting backwards from the highest number until it gets to the beginning. So when a new higher one is unlocked it counts that as well
hello, if there are different ID instead of producePrice0, 1, 2..., what should I type if I want the automation to behave as the video shows? (from the highest possible cost of items)
thank you for this videos , there are extremely helpful and professional can you do a video of how you began programming and what did you learn from the start ?
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
Tim again a great video! I'm learning machine learning right now and looking to move to deep learning later. Is it necessary for me to learn reinforcement learning, NLP and computer vision to get a good ml job?
I just found this video but hopefully this will help future people. actions.click() lets you also add on more actions like another actions.click() which will all be done when you call actions.perform().
Hey Tim - thanks for the great lesson.Learnt a new method which is helping me a lot. Here's a question for you : how do I close out a currently running instance of Actionchains and start a new instance of Actionchains? The reason I am asking this is I have a code whereby, the Actionchains running on current commands, are repeating themselves, everytime I run actionchains on a new command (e.g. it types out the username everytime I am using the current instance of Actionchains). I have found a workaround in which I am calling the perform() action right after all actionchains are executed - but I wanted to check anyway, if it is possible to have another solution, which involves a new instance, thus cancelling the earlier/current instance (I have also found another command which is reset, but that does not seem to work for me)
Go to code with Harry RUclips channel and in his playlist section you will find python tutorials and at last of his playlist you will get full source code with explanation .
Getting this error: Traceback (most recent call last): File "C:/Users/user/PycharmProjects/Selenium_Tutorial/tutorial_4.py", line 27, in count = int(cookie_count.text.split(" ")[0]) AttributeError: 'list' object has no attribute 'text'
I had the same problem. The way to fix it is to put the whole action chain in the for loop. So your code should look something like this for i in range(5000): actions = ActionChains(driver).click(cookie).perform()
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.
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
Diddnt you want to make it do grandma first? Now it's just doing the hand thing. Anyway good fun! Mail scripts and timers are fun too. Ofcourse strictly for automating job interviews ^^ cookie grandma's aside, automated messages could be rly good for demented ppl. Help them remind things.
Thanks a lot for great tutorials. I have installed Sublime Text and I have saved the file with .py extension. But I didn't get IntelliSense when typing the code. How can I activate such feature?
I don't use sublime but vscode and there you can very easily get the python intelligence and I found it even more powerfull than sublime. So try it also
I'm only in 9th grade, but I am doing what you are, getting really good with one, but I would learn a few more. no need to be an expert, just pretty fluent
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?
Just ran into this myself. In my case it was because I used "find_elementS_by_id" whereas Tim used "find_element_by_id" - likely that you did the same thing since it's an error caused by "find_elements_by_id" returning a list of web elements according to the same stack overflow thread you probably found.
Dude is someone still watching these videos? this guy is real good!
yeah i am
I believe the explanation of implicit wait at 5:44 is incorrect. You say the line will not be passed for 5 seconds but I believe what is actually happening is you are setting a global setting to wait up to 5 seconds whenever anything you are are looking for does not yet exist. Great videos, thanks for making them!
Yes, he set driver to find stuff within 5 seconds or throw an exception.
Thanks man for such an amazing tutorials. your style of teaching is just like Corey Schafer one of my best teacher ever.
I literally made the same project 2 weeks ago, it’s a fun little one. Great job nonetheless !
Tim a little tip When you Don't find the element 4:25 aprox. Try to go the arrow on the top left of the inspect window. It should work
The pyautogui module can be used in order to not get banned by websites.
Pls tell how
@@Sk_-vu6dv Let's imagine you are playing a click game on a website (the most number of kills win), if you use selenium you will get banned because the website can detect a use of bot. But pyautogui module sends key inputs, mouse presses making it seem that there is no bot running but a normal user is sending those clicks. Thus, you will break the game.
@@smitamaheshwari1377 Oh okay , thats cool actually i didnt know what pyautogui exactly does , thanks for the info
@Blessed People! I don't really think so. I have never experienced speed problems with pyautogui however pyautogui can be messy sometimes.
Yes pyautogui works really well. If you are trying to make a bot that runs on your computer, then pyautogui is definitely the way to go. I use selenium for off computer navigating where you want it to run on a server.
"if we have a 100 cookies, I'd like to do grandma"
When Tim said that, I immediately got in comments to check if someone noticed that xD
@@ante1708 just what I did too. 😄
Use clipboard history built into windows win+v instead of struggling to copy and paste multiple items. It's so useful.
could you explain more? Thank you!
that was pretty straight forward for you to say "For any of my tut, i simply go through the docs itself" ik you meant the brush up before every tut but still. Anyway I really liked your tuts -simple, easy and precise.
Nope. He learns all the modules through the docs.
@@pianopianist5709 bet you know it all
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
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.
Hey Tim, I think the glitch was caused by the ',' in the price of the item: "1,100" instead of just "1100"
ye, just add a cookie_count.replace(",", "")
@@barbadose but it is saying web element has no attribute replace
@@sudhanshudey758 you need to say cookie_count.text.replace(",", "")
totally right
Thanks for making me the best player at this game!
Just am in love with your style of teaching and materials!!! Amazing!!! Wow...!!!
Very nice tutorial. Useful thing would be to add some random sleep (0.1-0.3 sec) between clicks against detection.
I tried and double_click instead of click, it works perfectly
❤
An excellent and highly informative tutorial.
Can't wait for more tutorials :) Great job!
Mee too can't wait
But he stopped at 6 tutorials
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
Funny that Tim shows his hands off the mouse, but never his feet. He's definitely just using feet mouse
Sitting through your Ads, cos you deserve it!!
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?
Same thing
Same
same here
same
Thank you. I had the same issue and your way worked for me too.
The video was really good as always. Just a suggestion: don't use implicitly wait. Instead you can use explicitly wait which allows the browser to wait until a certain condition occurs (selenium-python.readthedocs.io/waits.html). Sorry for the bad english.
Doesn't work
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
opened browser?
I hope you will make a playlist for this. I’ll watch this series once it’s complete
Hey man not sure if you read the comments but just from these 4 videos I automated checking a website if someone had cancelled their appointment and to text me if that appointment is sooner than the existing available date.
you could've created and stored the actions in a list beforehand(as there are only a few) and just call them in the "for I in range(5000)" instead of creating them over and over again.
help, when I try item.text the program give me this error: AttributeError: 'list' object has no attribute 'text'
how can I fix it????
Man wish this came out 2013 when Cookie clicker was LIFE
Hey Tim, Thank you so much for the tutorial!
im in love with your voice!!🤩🤩🤩 you could easily voice for an animation
Thanks!!
Thanks! Please continue!
At 11:25, why need to first move to element then click? Can't I just click(item)? Thanks
I had to start laughing when my coworkers saw me with cookie cliker in the screen, and questioned me about playing games in worktime.
Thanks for one more great Tutorial
Is the try block and implicitly_wait function the same? can we just alternate between them?
Thank u so much bro im making 9 billion cookies a second now
LOL
Hopefully you will come back to this series one day :/
Super! It's a kind of magic...
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?
How do other websites detect bots?
How easily can other websites detect a bot?
Just discovered your channel, BIG thumbs up!
Tim, you're awesome!
Thanks for the great vids.
got hooked onto the game instead 🤣
Nice one Tim!
👍✌️
I use time.sleep() over driver.implicitly_wait(). Is one better to use then the other?
Another question- Why is `.move_to_element` required? Can't we simply use .click function like you were doing in earlier tutorials?
how does the program know where to click without telling it?
@@a.yashwanth it was already said when he type the id from where to click in ...=driver.find_element_by_id(id) for example
to remove glitch just do cookie_count.text.split(" ")[0].replace(" , " , "")
the voice of yours is so charming
Line 14, i'm getting an error 'no such element: unable to locate element'. I typed "productPrice" as Tim did. The actual element ID is 'product price 0' but why isn't it typed as such?
what's the difference between waiting with implicite wait or time.sleep() ? in both cases we won't pass that line until that duration we specified is over and the website is opened
Waitiingg for your series on data structures and algorithms. When will it going to start??
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?
In the next vid pls briefly explain div and other html tags required
Thank you tim for these great videos >:)
woahh thats awesome
Hi Tim, great video. I don't understand the purpose of action chains, how is using them different from writing a regular function with all the things i want the web element to do?
How do I make it upgrade the further upgrades as well? If I change the "for i in range(1,-1,-1) to (2,-1,-1) it gives me an invalid int error.
Idk if you still need it but what he put should upgrade the farther ones as well. It’s just counting backwards from the highest number until it gets to the beginning. So when a new higher one is unlocked it counts that as well
Thank you! I wonder how can I speed up the clicking? Like clicking 100 times a second
You are good, bro
hello, if there are different ID instead of producePrice0, 1, 2..., what should I type if I want the automation to behave as the video shows? (from the highest possible cost of items)
thank you for this videos , there are extremely helpful and professional can you do a video of how you began programming and what did you learn from the start ?
that's cool bro
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
I noticed the same result. Not using Action Chain has better performance.
if in driver.get('link' ) , link is not working then how can we go on other link(web page)
I couldn't understand why we need to upgrade_actions.move_to_element ?
What if i wanted to upload a file to the website ? What should i do then coz it as soon as hit the browse button driver has no access to the window
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
inside the loop cookie_count is called, will it go back and do the driver.find , is that how the value changes. ?
Tim again a great video!
I'm learning machine learning right now and looking to move to deep learning later. Is it necessary for me to learn reinforcement learning, NLP and computer vision to get a good ml job?
hello Tim, which plugin do you use for intellisenses ??
Is it also possible to interact with a chrome tab that already has opened, because everytime it opens a new tab?
Not sure why
use driver.close() it will close the tab after the operation
I didn't understand the use of ActionChains here. Can't you just do 'cookie.click()' instead of 'actions.click(cookie)'?
I just found this video but hopefully this will help future people.
actions.click() lets you also add on more actions like another actions.click() which will all be done when you call actions.perform().
nice tim kepp it up.
Hey Tim - thanks for the great lesson.Learnt a new method which is helping me a lot. Here's a question for you : how do I close out a currently running instance of Actionchains and start a new instance of Actionchains? The reason I am asking this is I have a code whereby, the Actionchains running on current commands, are repeating themselves, everytime I run actionchains on a new command (e.g. it types out the username everytime I am using the current instance of Actionchains).
I have found a workaround in which I am calling the perform() action right after all actionchains are executed - but I wanted to check anyway, if it is possible to have another solution, which involves a new instance, thus cancelling the earlier/current instance (I have also found another command which is reset, but that does not seem to work for me)
what will be the css_selector for
a[title='Next']
can you do a live stream tim, it would be nice.
I want to make a Jarvis like Ai as my project but I need a help.
Go to code with Harry RUclips channel and in his playlist section you will find python tutorials and at last of his playlist you will get full source code with explanation .
Hi Tim. Thanks for the video. I need an help in a project. Do you have made any video on how to handle input textbox read-only with list drop-down?
Hey Tim! what about Selenium web plugin? Is it recommended?
Who wants a video on how to run selenium on aws ec2 so we can run auto daily
Getting this error:
Traceback (most recent call last):
File "C:/Users/user/PycharmProjects/Selenium_Tutorial/tutorial_4.py", line 27, in
count = int(cookie_count.text.split(" ")[0])
AttributeError: 'list' object has no attribute 'text'
maybe you got sth wrong in the line :cookie_count=driver.find_element_by_id("cookies") ?
I do This proyect but with AI libraries
The proyect do clicks in the publishing
I have a problem. Command perform() just ignores the for i in range(5000). It runes chain just one time. MacBook.
I had the same problem. The way to fix it is to put the whole action chain in the for loop. So your code should look something like this
for i in range(5000):
actions = ActionChains(driver).click(cookie).perform()
@@robbie8545 logged into my main acct to thank you for this!
@@robbie8545 thank you!
Why I get :
ValueError: invalid literal for int() with base 10:
for line 21. I just copy the same code as yours?
"like to do Grandma!!!"
-Tim
LOL!!!!!
my script is not buying the upgrades. I wrote the same code though.
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.
How can we inspect some very secured pages which do not have any Inspect element options ?? Anybody knows ??
Why we should do move_to_element ?
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
Hey Tim, I'm struggling on how to automatically get rid of the cookie acceptance popups every time...how can we solve that with Selenium? Thx
Very simple, just watch the videos before and you will know how to do it :)
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
Diddnt you want to make it do grandma first? Now it's just doing the hand thing. Anyway good fun! Mail scripts and timers are fun too. Ofcourse strictly for automating job interviews ^^
cookie grandma's aside, automated messages could be rly good for demented ppl. Help them remind things.
Just let it run. The prices go up as you advance and eventually the cursor costs more than grandmas and you start them.
Bro pliss help when i run i got error cann't import name Action Chains
Thanks a lot for great tutorials. I have installed Sublime Text and I have saved the file with .py extension. But I didn't get IntelliSense when typing the code. How can I activate such feature?
I don't use sublime but vscode and there you can very easily get the python intelligence and I found it even more powerfull than sublime. So try it also
May I ask, can i stick with only one programming language (e.g Python)? for my career startup in programming?
I'm only in 9th grade, but I am doing what you are, getting really good with one, but I would learn a few more. no need to be an expert, just pretty fluent
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?
Just ran into this myself. In my case it was because I used "find_elementS_by_id" whereas Tim used "find_element_by_id" - likely that you did the same thing since it's an error caused by "find_elements_by_id" returning a list of web elements according to the same stack overflow thread you probably found.
Aren't action chains basically performing the same role as declaring a function?
How can we press the down arrow key in selenium