Skip to content

Instantly share code, notes, and snippets.

@biske
Last active December 23, 2015 01:59
Show Gist options
  • Save biske/6563607 to your computer and use it in GitHub Desktop.
Save biske/6563607 to your computer and use it in GitHub Desktop.
if page.has_no_selctor?(:xpath, "//h1", text: "Missing Deal")
if page.has_selector?(:xpath, '//*[@id="deal_merchant_display_name"]')
sheet[red,0] = find(:xpath, '//*[@id="deal_merchant_display_name"]').text
end
if page.has_selector?(:xpath, '//*[@id="option_title_for_deal"]')
sheet[red,1] = find(:xpath, '//*[@id="option_title_for_deal"]').text
end
if page.has_selector?(:xpath, '//*[@id="view-details-full"]/p[2]')
sheet[red,2] = find(:xpath, '//*[@id="view-details-full"]/p[2]').text
end
if page.has_selector?(:xpath, '//*[@id="view-details-full"]/div[2]/p[1]')
sheet[red,3] = find(:xpath, '//*[@id="view-details-full"]/div[2]/p[1]').text
end
if page.has_selector?(:xpath, '//*[@id="view-details-full"]/div[2]/p[2]')
sheet[red,4] = find(:xpath, '//*[@id="view-details-full"]/div[2]/p[2]').text
end
sheet[red,5] = current_url
if page.has_selector?(:xpath, '//*[@id="view-details-full"]/p[3]/a[1]')
sheet[red,6] = find(:xpath, '//*[@id="view-details-full"]/p[3]/a[1]')[:href]
end
if page.has_selector?(:xpath, '//*[@id="0_location"]/div[2]/span[1]')
sheet[red,7] = find(:xpath, '//*[@id="0_location"]/div[2]/span[1]').text
end
if page.has_selector?(:xpath, '//*[@id="0_location"]/div[2]/span[2]')
sheet[red,8] = find(:xpath, '//*[@id="0_location"]/div[2]/span[2]').text
end
red +=1
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment