Skip to content

Instantly share code, notes, and snippets.

@nickzam
nickzam / lxml_get_namespace
Created June 20, 2013 09:02
Get used namespace for lxml.etree xpath
from lxml import etree
tree = etree.fromstring(xml)
for elem in tree.getiterator():
print elem.tag, elem.attrib
require 'httparty'
require 'capybara'
require 'capybara/dsl'
include Capybara::DSL
require 'capybara-webkit'
@nickzam
nickzam / gist:2836369
Created May 30, 2012 13:37
cucumber capybara webkit error
zam@r2d2:~/projects/cucumber2$ cucumber
Feature: Account Registration and Login
@javascript
Scenario: User searches for item in search bar and finds list of possible # features/account_reg_and_login.feature:4
matched items
Given "item" in search bar on site "http://www.reviewcentre.com" # features/step_definitions/account_reg_and_login_steps.rb:7
When it has all possible matched items labelled "ItemCardSlim" # features/step_definitions/account_reg_and_login_steps.rb:19
No response received from the server. (Capybara::Driver::Webkit::WebkitNoResponseError)
./features/step_definitions/account_reg_and_login_steps.rb:20:in `/^it has all possible matched items labelled "(.*?)"$/'