Automate claim free ebook from packtpub to your packtpub account by robotframework script.
# ubuntu
$ apt-get -y update
$ apt-get -y install python-dev python-pip
$ apt-get install -y phantomjs libicu52 wget
$ wget https://raw.githubusercontent.com/Pyppe/phantomjs2.0-ubuntu14.04x64/master/bin/phantomjs -O /usr/bin/phantomjs && chmod +x /usr/bin/phantomjs
$ pip install robotframework
$ pip install robotframework-selenium2library
# Edit {USER} and {PASSWORD} first !!!
$ pybot robot-packtpub.txt
We use XPath to locate where button and input form are that not flexible, It may change when Web UI changed (XPath is Best Solution that I found). You can find XPath by following this video - Quick Tip: Getting The XPath In Google Chrome.
PhantomJS2.0 fixed this issue
We use Xvfb Firefox for headless browser instead of PhantomJS that have some problem on docker in this case.
You can use Travis-CI and Nightly Builds to run your script everyday - See demo here.