0

So in the PHP world there is an abstraction layer you can use called Mink which runs on top of selenium which gives you a much nicer interface than straight selenium webdriver. An example of what this looks like is below:

// set the default session name
$mink->setDefaultSessionName('goutte2');

// visit a page
$mink->getSession()->visit($startUrl);

// call to getSession() without argument will always return a default session if has one (goutte2 here)
$mink->getSession()->getPage()->findLink('Downloads')->click();
echo $mink->getSession()->getPage()->getContent();

Is there a similar project to this in the Python world? My google-fu isn't coming up with much. It doesn't necessarily have to be a testing framework, I would like to use it to do some information extraction without having to write straight webdriver code.

alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195

2 Answers2

1

splinter claims to be the one:

Splinter is an abstraction layer on top of existing browser automation tools such as Selenium, PhantomJS and zope.testbrowser. It has a high-level API that makes it easy to write automated tests of web applications.

alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195
  • It's pretty good, a little rough around the edges maybe but there seems to be good documentation for using it with lettuce (which would be a more common case). –  Aug 10 '15 at 19:16
  • @RyanM I've personally tried `splinter` multiple times and I still think bare python selenium bindings are good and clear enough.. – alecxe Aug 10 '15 at 19:18
  • I wish there was a straight port of Mink, it has some really nice methods for doing extremely common tasks (like looking up fields without having to dig into xpaths/ids/classnames/etc). –  Aug 10 '15 at 19:55
  • @JamesGeraldo sorry, just curious, could you explain why have you unaccepted the answer? Thanks. – alecxe Sep 28 '15 at 22:16
1

You could try Robot Framework for a really high-level interface. It's Python inside but basically works with any language/environment.

Andy Mikhailenko
  • 1,571
  • 1
  • 11
  • 10