Using scraped text in another xpath/regex/processors

48 views
Skip to first unread message

Boy Sandy Gladies Arriezona

unread,
Dec 23, 2016, 2:40:50 AM12/23/16
to django-dynamic-scraper

Hi, I want to scrape this json response:

{
      "id": "129460001",
      "fields": {
        "vendor_alias": [
          "unicorner"
        ],
        "item_min_qty": [
          "1"
        ],
        "vendors_min_array": [
          "1"
        ],
        "vendor_default": [
          "Unicorner"
        ],
        "vendors_stock_array": [
          "5"
        ],
        "item_default": [
          "60090"
        ],
        "vendors_price_array": [
          "93800.00"
        ],
        "item_name": [
          "Baseus Sky Case For iPhone 7 Transparent"
        ],
        "vendors": [
          "Unicorner"
        ],
        "item_image_url": [
          "assets/img/Libraries/img-86714-1599-sky-case-for-iphone-7-transparent.jpg"
        ],
        "item_alias": [
          "baseus-sky-case-for-iphone-7-transparent-129460001"
        ],
        "item_rating": [
          "0"
        ],
        "vendors_discount_array": [
          "0"
        ],
        "vendors_item_array": [
          "60090"
        ],
        "vendors_id_array": [
          "10854"
        ],
        "brand_id": [
          "1599"
        ],
        "item_min_discount": [
          "0"
        ],
        "item_stock": [
          "5"
        ],
        "item_min_price": [
          "93800"
        ],
        "vendor_default_id": [
          "10854"
        ]
      }
    }


My problem is when I try to get the url for this item. I should manually combine several json key with string because there is not any key which told me the exact url for this item. This is the example:
base_url + "v" + vendor_alias + "product" + item_alias


I can hardcode the base_url with static processor, but vendor_alias is relative to this items. Is it possible to do this kind of thing in DDS?

Holger Drewes

unread,
Jan 3, 2017, 9:52:25 AM1/3/17
to django-dyna...@googlegroups.com
Not sure, if this solves your problem, but maybe have a look at attribute placeholders:

Holger

--
Sie erhalten diese Nachricht, weil Sie in Google Groups E-Mails von der Gruppe "django-dynamic-scraper" abonniert haben.
Wenn Sie sich von dieser Gruppe abmelden und keine E-Mails mehr von dieser Gruppe erhalten möchten, senden Sie eine E-Mail an django-dynamic-scraper+unsub...@googlegroups.com.
Weitere Optionen finden Sie unter https://groups.google.com/d/optout.

k bez

unread,
May 6, 2017, 8:00:09 AM5/6/17
to django-dynamic-scraper
Holger i have same problem cause attrib placeholders are supporting  inside form data.
Is it possible we have attrib placeholders inside form data or another way to achieve it?
Reply all
Reply to author
Forward
0 new messages