Cool Social Media Sharing Touch Me Widget by Blogger Widgets



Wednesday 11 December 2013

How to generate Internet traffic with Selenium - part 3

The Selenium website has available downloads and documentation that should help beginners with the software. As a .NET developer, I am used to using Visual Studio and C# to use Selenium. But for those that do not have a Visual Studio license, it may be easier to use Selenium with Java. There are some great, free IDEs for Java such as Netbeans and Eclipse. Stackoverflow is also a great site for programming questions and answers.

I will be writing all my code examples in C#, but it is very similar to Java, and should be easy enough to translate from language to the other with some basic programming knowledge, it will mostly just be a case of knowing the difference between the Selenium APIs for the different languages.

So, in a nutshell, I open a Firefox browser with Selenium, go to Hide My Ass (ensuring that I visit my blog post via different IPs), go to my blog post via Hide My Ass, close my browser, and repeat. In all fairness, you could just hit F5 repeatedly to increase your pageviews. But at least this way the process is automated, and the page views will come from a range of different IP addresses.

As explained in an earlier post, this will not be a programming tutorial, more of an experiment into generating web traffic by using Selenium, but I will include a code example to give you an idea how I am using Selenium.

Simple code example (comments are preceded by //):

FirefoxDriver firefoxDriver = new FirefoxDriver(); // initialize web driver
firefoxDriver.Navigate().GoToUrl("http://hidemyass.com/"); // go to hide my ass
WebDriverWait wait = new WebDriverWait(driver.Value, TimeSpan.FromSeconds(10));
// initialize object that will wait for page elements, so we can wait until HMA is loaded before clicking
wait.Until((d) => d.FindElement(By.Id("hmabutton")).Displayed); // wait for button on HMA page
firefoxDriver.FindElement(By.Id("hmaurl")).SendKeys("http://handynettips.blogspot.co.uk/2013/12/how-to-watch-films-on-movie2k-when-it.html"); // enter the target blog url into the HMA search box
firefoxDriver.FindElement(By.Id("hmabutton")).Click(); // click the HMA button and go to the blog page
// wait for an element on the blog page (as with above wait code)
firefoxDriver.Quit(); // close the browser

Stick all of the above in a loop and the process can be repeated as many times as you like. With Selenium it would be possible to run several different browsers (Chrome, IE, Firefox, Opera, Safari, Android) at the same time, and several instances of each browser. In theory, you could generate thousands of views per day.

One downside of Selenium is, if you are running it on the computer that you would usually use, browser windows constantly opening and closing would distract you from your work. If you have a spare machine it would probably be more convenient to use on that. Also, Selenium Grid allows you to run browsers on a remote machine, this is a little more complicated but in my experience, more reliable than using the custom Firefox/Chrome drivers, etc.

As stated previously, this is a work in progress, and I am unsure how successful this experiment will be, if at all. In all likelihood I will get banned once Blogger figure out that I am generating web traffic with Selenium, please do not go and point Selenium at your website or blog if you are serious about your page views, or at least look further into it than I have, this is just for fun.

So far, I have Selenium constantly revisiting one of my blog posts in order to increase its web traffic. This is fairly basic, but imagine the other possibilities with automated web browsing - I could Tweet links to my blog on an automatic timer, automatically build an online presence - for each post on my blog, post to Youtube, Reddit, StumbleUpon, Facebook likes, etc.

Of course, taking this too far would be seen as spamming and result in accounts being banned. Ever wonder what those annoying captchas are for? For preventing automated processes from being able to create thousand of fake accounts, for example. But I'm convinced that some of the big boys in SEO use similar, if far more advanced and sophisticated techniques to boost their web rankings.

In the next post, I will look at the possibility of using Selenium to build a social networking presence.

16 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. looks like an interesting idea, what has been the final outcome of generating web traffic using selenium? Also, I think you will be generating traffic but from 1 IP only. You would not have unique visitors. Does a lot of traffic from 1 single or a lets say 10 IPs only help? Looking forward to know about your tweak idea.

    ReplyDelete
  3. Excellent goods from you, man. I’ve understand your stuff previous to and you’re just too excellent. I actually like what you’ve acquired here, certainly like what you are stating and the way in which you say it. You make it enjoyable and you still take care of to keep it sensible. I can not wait to read far more from you. This is actually a tremendous site..

    Selenium Training in Chennai

    ReplyDelete
  4. This is a nice article here with some useful tips for those who are not used-to comment that frequently. Thanks for this helpful information I agree with all points you have given to us. I will follow all of them.
    best rpa training in bangalore
    rpa training in bangalore
    rpa course in bangalore
    RPA training in bangalore
    rpa training in chennai
    rpa online training

    ReplyDelete
  5. This is a nice article here with some useful tips for those who are not used-to comment that frequently. Thanks for this helpful information I agree with all points you have given to us. I will follow all of them.
    best rpa training in bangalore
    rpa training in bangalore
    rpa course in bangalore
    RPA training in bangalore
    rpa training in chennai
    rpa online training

    ReplyDelete
  6. Useful information.I am actual blessed to read this article.thanks for giving us this advantageous information.I acknowledge this post.and I would like bookmark this post.Thanks
    AWS Training in pune
    AWS Online Training
    AWS Training in Bangalore

    ReplyDelete
  7. This comment has been removed by the author.

    ReplyDelete
  8. I am see the programming coding and step by step execute the outputs.I am gather this coding more information.It's helpful for me .... Thanks for sharing
    aws training in chennai | aws training in annanagar | aws training in omr | aws training in porur | aws training in tambaram | aws training in velachery

    ReplyDelete