sarafg11

Untitled

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