Skip to content

Instantly share code, notes, and snippets.

@jaturken
Last active October 20, 2015 14:30
Show Gist options
  • Save jaturken/a40f1d9140199595e922 to your computer and use it in GitHub Desktop.
Save jaturken/a40f1d9140199595e922 to your computer and use it in GitHub Desktop.
1234
products_data = page_content.xpath("//div[contains(@class, 'snippet-list')]/div[contains(@class, 'snippet-card')]")
products_data.map do |product_data|
name = product_data.xpath(".//span[@clas='snippet-card__header-text']").text
url = product_data.xpath(".//a[span[@class='snippet-card__header-text']]/@href").text
is_new = !product_data.xpath(".//div[@class='stickers__sticker stickers__sticker_type_new']").empty?
products_names << name
products_utls << url
products_new_one << is_new
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment