sarafg11

Untitled

Dec 1st, 2020 (edited)
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.51 KB | None | 0 0
  1. {
  2. "start_urls": [
  3. "https://www.walmart.ca/en/grocery/dairy-eggs/yogurt/classic-yogurt/N-4532"
  4. ],
  5. "fields": {
  6. "name": "//h1[@data-automation='product-title']/text()",
  7. "price": "",
  8. "reference": "",
  9. "image": "//meta[@property='og:image']/@content",
  10. "description": "//script[contains(.,'longDescription')]/text()",
  11. "brand": "",
  12. "brand_text": "//span[@data-automation='brand']/a/text()",
  13. "categories": "(//ol[@data-automation='desktop-breadcrumbs']/li/a[@target='_self'])[position()>1]/text()",
  14. "rating_average": "",
  15. "rating_count": "",
  16. "barcode": "",
  17. "stock": "",
  18. "sku": "substring-before(substring-after(//script[@type='application/ld+json' and contains(text(), '\"@type\":\"Product\"')]/text(), 'sku\":\"'), '\",')"
  19. },
  20. "json_fields": {
  21. "price": "$.*.online[0].maxCurrentPrice",
  22. "price_old": "$.*.online[0].maxRegularPrice",
  23. "availability": "$.*.online[0].status",
  24. "seller": "$.*.online[0].sellerName"
  25. },
  26. "links": {
  27. "detail": "//a[@class='product-link']",
  28. "next_page": "//div[@id='shelf-pagination']//a[@id='loadmore']"
  29. },
  30. "regex": {
  31. "description": ["longDescription\\\":\\\"(.*?)\\\"", 1]
  32. },
  33. "parser_modules": [
  34. "walmart_single_item"
  35. ],
  36. "pipelines": {
  37. "AvailabilityPipeline": {
  38. "forced_false": "NotSold"
  39. }
  40. },
  41. "list": {
  42. "product": "//article[contains(@class, 'product')]",
  43. "page": "//ul[@class='page-select-list']/li[contains(@class,'selected')]/a/text()"
  44. }
  45. }
Advertisement
Add Comment
Please, Sign In to add comment