How to extract Product ID from Product URL

I need to extract the Product ID, however, the ID is included in link.

How to extract this ID from link ?

link of product
https://www.lazada.vn/products/freeship-ta-bim-moony-natural-quan-dan-noi-dia-nhat-cao-cap-nb63s58m46l38l36xl32-i1391488471-s5766423057.html

  • 1391488471 is ID I need to get

Link of list that I used to extract
https://www.lazada.vn/tag/moony/?q=moony&_keyori=ss&from=input&spm=a2o4n.officialstores.search.go.13216780qZl5tY&catalog_redirect_tag=true

Url: http://example.com

Sitemap:
{id:"sitemap code"}

@migen Hi, try using the text selector span.key-title:contains("SKU") + div with regex - ^([^_])+

Example:

{"_id":"lazada-sku","startUrl":["https://www.lazada.vn/products/freeship-ta-bim-moony-natural-quan-dan-noi-dia-nhat-cao-cap-nb63s58m46l38l36xl32-i1391488471-s5766423057.html"],"selectors":[{"id":"ID-script","multiple":false,"parentSelectors":["scroll"],"regex":"^([^_])+","selector":"span.key-title:contains(\"SKU\") + div","type":"SelectorText"},{"delay":200,"elementLimit":0,"id":"scroll","multiple":true,"parentSelectors":["_root"],"selector":"body","type":"SelectorElementScroll"}]}

1 Like