var webdriver = require('selenium-webdriver');
var driver = new webdriver.Builder().
withCapabilities(webdriver.Capabilities.chrome()).
build();
driver.get('https://www.tumblr.com/login');
driver.findElement(webdriver.By.id('signup_email')).sendKeys('my_username');
driver.findElement(webdriver.By.id('signup_password')).sendKeys('my_password');
driver.findElement(webdriver.By.id('signup_forms_submit')).click();
driver.wait(function(){
driver.get('https://www.tumblr.com/search/love+gifs');
},5000);
driver.wait(function(){
driver.findElement(webdriver.By.id("post_control like")).click();
},1000);
driver.wait(function(){
driver.findElement(webdriver.By.id("follow-text")).click();
},1000);
driver.quit();
<div class="post-info-post-tumblelog">
<div class="post-info-tumblelog">
<a class="follow_link worded-follow-button show-unfollow" data-subview="follow" href="/follow/pleasingpics" style="width: 41px;">
<div class="follow-text" title="Follow">Follow</div>
<div class="unfollow-text" title="Unfollow">Unfollow</div>
</a>
</div>
</div>
I have a Javascript code for following some accounts on Tumblr using Selenium WebDriver.
In the HTML code, there is a follow button as you can see in a class named "follow-text". But my code doesn't work, also I'm wondering that follow button is not actually a button but they've made it a clickable div class. I'm not so familiar with HTML/CSS and I'm new with Javascript and Selenium Webdriver. What's wrong with my code? Also I have to click follow buttons on different posts on the same page. I'm thinking of creating a loop but I can't even click one of them. Any help will be appreciated.