Skip to content
Advertisement

Selenium Instagram Bot – Clicking the “Like” Button

I have written a program to go on the Instagram explore page, and like the first six photos.

Right now, I am using this rather convoluted method to find the “Like” button.

I would much rather have it formatted like I did the “click the login button” section.

So far, I have tried inspecting various elements, but I cannot pinpoint the correct one to make it uniquely select the “Like” button. Also, I could just need to use an attribute that I am unfamiliar with to uniquely select the like button.

I am super new to the python and also the selenium, so any help is appreciated.

JavaScript

Advertisement

Answer

to click on like, that web element is in svg tag, so try the below locator :

JavaScript

something like :

JavaScript

Also, I am not sure what do you mean by

JavaScript
User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement