Skip to content

Instantly share code, notes, and snippets.

@vladbatushkov
Created May 7, 2019 16:32
Show Gist options
  • Save vladbatushkov/feef7535f2dfee21efdb1e6fc31e7b67 to your computer and use it in GitHub Desktop.
Save vladbatushkov/feef7535f2dfee21efdb1e6fc31e7b67 to your computer and use it in GitHub Desktop.
Grab perfume products of brands starts from 4, I, O.
WITH ["4", "I", "O"] as list
MATCH (b:Brand)
WHERE apoc.coll.contains(list, left(b.name, 1)) = true
WITH "https://www.fragranceoutlet.com" + b.url as url, b
CALL apoc.load.html(url, { products: "a.product-grid-item p.product-title" }) YIELD value
UNWIND value.products as product
MERGE (p:Product { name: product.text })
MERGE (p)-[:PRODUCED_BY]->(b)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment